Skip to content
Allure report logoAllure Report
Main Navigation ModulesDocumentationStart

English

Español

English

Español

Appearance

Sidebar Navigation

Introduction

Install & Upgrade

Install for Windows

Install for macOS

Install for Linux

Install for Node.js

Upgrade Allure

Getting started

How to view a report

Improving readability of your test reports

Improving navigation in your test report

Features

Test steps

Attachments

Test statuses

Sorting and filtering

Defect categories

Visual analytics

Test stability analysis

History and retries

Timeline

Export to CSV

Export metrics

Guides

JUnit 5 parametrization

JUnit 5 & Selenide: screenshots and attachments

JUnit 5 & Selenium: screenshots and attachments

Setting up JUnit 5 with GitHub Actions

Pytest parameterization

Pytest & Selenium: screenshots and attachments

Pytest & Playwright: screenshots and attachments

Pytest & Playwright: videos

Playwright parameterization

How it works

Overview

Test result file

Container file

Categories file

Environment file

Executor file

History files

Integrations

Azure DevOps

Bamboo

GitHub Actions

Jenkins

JetBrains IDEs

TeamCity

Visual Studio Code

Frameworks

Behat

Getting started

Configuration

Reference

Behave

Getting started

Configuration

Reference

Codeception

Getting started

Configuration

Reference

CodeceptJS

Getting started

Configuration

Reference

Cucumber.js

Getting started

Configuration

Reference

Cucumber-JVM

Getting started

Configuration

Reference

Cucumber.rb

Getting started

Configuration

Reference

Cypress

Getting started

Configuration

Reference

Jasmine

Getting started

Configuration

Reference

JBehave

Getting started

Configuration

Reference

Jest

Getting started

Configuration

Reference

JUnit 4

Getting started

Configuration

Reference

JUnit 5

Getting started

Configuration

Reference

Mocha

Getting started

Configuration

Reference

Newman

Getting started

Configuration

Reference

NUnit

Getting started

Configuration

Reference

PHPUnit

Getting started

Configuration

Reference

Playwright

Getting started

Configuration

Reference

pytest

Getting started

Configuration

Reference

Pytest-BDD

Getting started

Configuration

Reference

Reqnroll

Getting started

Configuration

Reference

REST Assured

Getting started

Configuration

Robot Framework

Getting started

Configuration

Reference

RSpec

Getting started

Configuration

Reference

SpecFlow

Getting started

Configuration

Reference

Spock

Getting started

Configuration

Reference

TestNG

Getting started

Configuration

Reference

Vitest

Getting started

Configuration

Reference

WebdriverIO

Getting started

Configuration

Reference

xUnit.net

Getting started

Configuration

Reference

On this page

Allure PHPUnit configuration ​

This page describes the configuration options that can be set in the configuration file for Allure PHPUnit.

By default, the configuration file is looked up at config/allure.config.php, but this location can be overridden, see Prepare your project.

outputDirectory ​

Path to the directory where Allure PHPUnit will save the test results, see How it works. If the directory does not exist, it will be created. Defaults to build/allure-results.

php
<?php

return [
    'outputDirectory' => 'build/allure-results',
];

linkTemplates ​

A mapping of templates that can be used to construct full URLs from short identifiers, see the reference.

Each key must be a link type identifier, and each value must be a class implementing the LinkTemplateInterface interface, or an object of such a class. When processing a link of the given type, Allure PHPUnit will call the buildUrl() method of the class.

php
<?php

use Qameta\Allure\Setup\LinkTemplateInterface;

return [
    'linkTemplates' => [

        'issue' =>
            new class implements LinkTemplateInterface {
                public function buildUrl(?string $name): ?string
                {
                    return "https://issues.example.com/$name";
                }
            },

        'tms' =>
            new class implements LinkTemplateInterface {
                public function buildUrl(?string $name): ?string
                {
                    return "https://tms.example.com/$name";
                }
            },

        'jira' =>
            new class implements LinkTemplateInterface {
                public function buildUrl(?string $name): ?string
                {
                    return "https://jira.example.com/browse/$name";
                }
            },
    ],
];

setupHook ​

A function that will be called before initializing the Allure PHPUnit lifecycle.

php
<?php

return [
    'setupHook' => function () {
        // ...
    },
];

lifecycleHooks ​

An array of one or more classes, each implementing one or more lifecycle hook interfaces for Allure PHPUnit. For example, such a class can modify test results before or after Allure PHPUnit's standard processing.

php
<?php

use Qameta\Allure\Hook\AfterTestStopHookInterface;
use Qameta\Allure\Hook\BeforeTestStartHookInterface;
use Qameta\Allure\Model\TestResult;

return [
   'lifecycleHooks' => [
        new class implements BeforeTestStartHookInterface, AfterTestStopHookInterface {

            public function beforeTestStart(TestResult $test): void
            {
                // ...
            }

            public function afterTestStop(TestResult $test): void
            {
                // ...
            }
        },
    ],
];

threadDetector ​

A class implementing the ThreadDetectorInterface interface, or an object of such a class. If set, Allure PHPUnit will use its getHost() and getThread() methods to determine the host and thread identifiers for a current test. The test results will be placed on the Timeline tab accordingly.

The example below assumes that you use pthreads for running your PHPUnit tests in parallel.

php
<?php

use Qameta\Allure\PHPUnit\Setup\ThreadDetectorInterface;

return [
    'threadDetector' => new class implements ThreadDetectorInterface {

        function getHost(): ?string
        {
            return gethostname();
        }

        function getThread(): ?string
        {
            return strval(Thread::getCurrentThread() . getThreadId());
        }
    },
];
Pager
Previous pageGetting started
Next pageReference
Powered by

Join our newsletter

Allure TestOps
  • Overview
  • Why choose us
  • Cloud
  • Self-hosted
  • Success Stories
Company
  • Documentation
  • Blog
  • About us
  • Contact
  • Events
© 2025 Qameta Software Inc. All rights reserved.