art of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\Baseline;

use function array_fill;
use function array_merge;
use function array_slice;
use function assert;
use function count;
use function explode;
use function implode;
use function str_replace;
use function strpos;
use function substr;
use function trim;

/**
 * @no-named-argumen

pstan-src/blob/1.10.33/src/File/ParentDirectoryRelativePathHelper.php
 */
final readonly class RelativePathCalculator
{
    /**
     * @var non-empty-string
     */
    private string $baselineDirectory;

    /**
     * @param non-empty-string $baselineDir

ts Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the backward compatibility promise for PHPUnit
 *
 * @see Copied from https://github.com/phpstan/ph


 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\Baseline;

use PHPUnit\Event\Test\NoticeTriggered;
use PHPUnit\Event\Test\NoticeTriggeredSubscriber;
use PHPUnit\Runner\FileDoesNotExistException;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by th

al readonly class TestTriggeredNoticeSubscriber extends Subscriber implements NoticeTriggeredSubscriber
{
    /**
     * @throws FileDoesNotExistException
     * @throws FileDoesNotHaveLineException
     */
    public function notify(NoticeTriggered $event

e backward compatibility promise for PHPUnit
 */
fin


 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\Baseline;

use PHPUnit\Event\Test\PhpWarningTriggered;
use PHPUnit\Event\Test\PhpWarningTriggeredSubscriber;
use PHPUnit\Runner\FileDoesNotExistException;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not cover

 */
final readonly class TestTriggeredPhpWarningSubscriber extends Subscriber implements PhpWarningTriggeredSubscriber
{
    /**
     * @throws FileDoesNotExistException
     * @throws FileDoesNotHaveLineException
     */
    public function notify(PhpWar


s=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\DeprecationCollector;

use PHPUnit\Event\Facade;
use PHPUnit\Event\Test\DeprecationTriggered;
use PHPUnit\TestRunner\IssueFilter;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal Thi

ns = [];

    /**
     * @var list<non-empty-string>
     */
    private array $filteredDeprecations = [];

    public function __construct(Facade $facade, IssueFilter $issueFilter)
    {
        $facade->registerSubscribers(
            new TestPreparedSu

s class is not covered by the backward compatibility promise for PHPUnit
 */
final class Collector
{
    private readonly IssueFilter $issueFilter;

    /**
     * @var list<non-empty-string>
     */
    private array $deprecatio


s=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\DeprecationCollector;

use PHPUnit\Event\Test\DeprecationTriggered;
use PHPUnit\TestRunner\IssueFilter;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by

**
     * @var list<non-empty-string>
     */
    private array $filteredDeprecations = [];

    public function __construct(IssueFilter $issueFilter)
    {
        $this->issueFilter = $issueFilter;
    }

    /**
     * @return list<non-empty-string>

the backward compatibility promise for PHPUnit
 */
final class InIsolationCollector
{
    private readonly IssueFilter $issueFilter;

    /**
     * @var list<non-empty-string>
     */
    private array $deprecations = [];

    /


* This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\ResultCache;

use PHPUnit\Framework\TestStatus\TestStatus;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This interface is not covered by the backward compatibility promise for PHPUnit
 */

s(ResultCacheId $id, TestStatus $status): void;

    public function status(ResultCacheId $id): TestStatus;

    public function setTime(ResultCacheId $id, float $time): void;

    public function time(ResultCacheId $id): float;

    public function load()

interface ResultCache
{
    public function setStatu


php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\ResultCache;

use PHPUnit\Event\Test\ConsideredRisky;
use PHPUnit\Event\Test\ConsideredRiskySubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This c

omise for PHPUnit
 */
final readonly class TestConsideredRiskySubscriber extends Subscriber implements ConsideredRiskySubscriber
{
    public function notify(ConsideredRisky $event): void
    {
        $this->handler()->testConsideredRisky($event);
    }
}

lass is not covered by the backward compatibility pr


art of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner;

use function array_map;
use function usort;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the backward compatibility promise for PHPUnit
 */
final class HookMethodCollection

od('setUpBeforeClass', 0), true);
    }

    public static function defaultBefore(): self
    {
        return new self(new HookMethod('setUp', 0), true);
    }

    public static function defaultPreCondition(): self
    {
        return new self(new HookM

{
    private readonly bool $shouldPrepend;

    /**
     * @var non-empty-list<HookMethod>
     */
    private array $hookMethods;

    public static function defaultBeforeClass(): self
    {
        return new self(new HookMeth


* This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\Baseline;

use function sprintf;
use PHPUnit\Runner\Exception;
use RuntimeException;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the backward compatibility pr

eException extends RuntimeException implements Exception
{
    public function __construct(string $file, int $line)
    {
        parent::__construct(
            sprintf(
                'File "%s" does not have line %d',
                $file,

omise for PHPUnit
 */
final class FileDoesNotHaveLin


are(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\DeprecationCollector;

use PHPUnit\Event\Test\Prepared;
use PHPUnit\Event\Test\PreparedSubscriber;

/**
 * @extends Subscriber<Collector>
 *
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUni

nal This class is not covered by the backward compatibility promise for PHPUnit
 */
final class TestPreparedSubscriber extends Subscriber implements PreparedSubscriber
{
    public function notify(Prepared $event): void
    {
        $this->collector()->te


<?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\ResultCache;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the backward compatibility promise for PHPUnit
 */
abstract readon

riber
{
    private ResultCacheHandler $handler;

    public function __construct(ResultCacheHandler $handler)
    {
        $this->handler = $handler;
    }

    protected function handler(): ResultCacheHandler
    {
        return $this->handler;
    }
}


tian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\Baseline;

use const FILE_IGNORE_NEW_LINES;
use function assert;
use function file;
use function is_file;
use function sha1;
use PHPUnit\Runner\FileDoesNotExistException;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the backwa

n-empty-string
     */
    private string $hash;

    /**
     * @var non-empty-string
     */
    private string $description;

    /**
     * @param non-empty-string  $file
     * @param positive-int      $line
     * @param ?non-empty-string $hash

rd compatibility promise for PHPUnit
 */
final readonly class Issue
{
    /**
     * @var non-empty-string
     */
    private string $file;

    /**
     * @var positive-int
     */
    private int $line;

    /**
     * @var no


tian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\ResultCache;

use const DIRECTORY_SEPARATOR;
use const LOCK_EX;
use function dirname;
use function file_get_contents;
use function file_put_contents;
use function is_array;
use function is_dir;
use function is_file;
use function is_float;
use function is_int;
use function is_string;
use function json_decode;
use function json_encode;

d compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the backward compatibility promise for PHPUnit
 */
final class DefaultResultCache implements ResultCache
{
    private const int VERSION                          = 2;
    priv

use PHPUnit\Framework\TestStatus\TestStatus;
use PHPUnit\Runner\DirectoryDoesNotExistException;
use PHPUnit\Runner\Exception;
use PHPUnit\Util\Filesystem;

/**
 * @no-named-arguments Parameter names are not covered by the backwar


n <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\ResultCache;

use PHPUnit\Event\InvalidArgumentException;
use PHPUnit\Event\Test\Finished;
use PHPUnit\Event\Test\FinishedSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the backward compatibility promise for

ber extends Subscriber implements FinishedSubscriber
{
    /**
     * @throws \PHPUnit\Framework\InvalidArgumentException
     * @throws InvalidArgumentException
     */
    public function notify(Finished $event): void
    {
        $this->handler()->test

PHPUnit
 */
final readonly class TestFinishedSubscri


 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\Baseline;

use PHPUnit\Event\Test\WarningTriggered;
use PHPUnit\Event\Test\WarningTriggeredSubscriber;
use PHPUnit\Runner\FileDoesNotExistException;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by

inal readonly class TestTriggeredWarningSubscriber extends Subscriber implements WarningTriggeredSubscriber
{
    /**
     * @throws FileDoesNotExistException
     * @throws FileDoesNotHaveLineException
     */
    public function notify(WarningTriggered $

the backward compatibility promise for PHPUnit
 */
f


* This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\TestRunner\Issue\DeprecationTriggered;
use PHPUnit\Event\TestRunner\Issue\DeprecationTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal Th

y promise for PHPUnit
 */
final readonly class TestRunnerTriggeredIssueDeprecationSubscriber extends Subscriber implements DeprecationTriggeredSubscriber
{
    public function notify(DeprecationTriggered $event): void
    {
        $this->collector()->test

is class is not covered by the backward compatibilit


ict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\TestRunner\ErrorTriggered;
use PHPUnit\Event\TestRunner\ErrorTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This cla

ise for PHPUnit
 */
final readonly class TestRunnerTriggeredIssueErrorSubscriber extends Subscriber implements ErrorTriggeredSubscriber
{
    public function notify(ErrorTriggered $event): void
    {
        $this->collector()->testRunnerTriggeredIssueErro

ss is not covered by the backward compatibility prom


?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\GarbageCollection;

use PHPUnit\Event\InvalidArgumentException;
use PHPUnit\Event\TestRunner\ExecutionFinished;
use PHPUnit\Event\TestRunner\ExecutionFinishedSubscriber as TestRunnerExecutionFinishedSubscriber;

/**
 * @no-named-argume

r extends Subscriber implements TestRunnerExecutionFinishedSubscriber
{
    /**
     * @throws \PHPUnit\Framework\InvalidArgumentException
     * @throws InvalidArgumentException
     */
    public function notify(ExecutionFinished $event): void
    {

nts Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the backward compatibility promise for PHPUnit
 */
final readonly class ExecutionFinishedSubscribe


?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\GarbageCollection;

use PHPUnit\Event\InvalidArgumentException;
use PHPUnit\Event\TestRunner\ExecutionStarted;
use PHPUnit\Event\TestRunner\ExecutionStartedSubscriber as TestRunnerExecutionStartedSubscriber;

/**
 * @no-named-arguments

tends Subscriber implements TestRunnerExecutionStartedSubscriber
{
    /**
     * @throws \PHPUnit\Framework\InvalidArgumentException
     * @throws InvalidArgumentException
     */
    public function notify(ExecutionStarted $event): void
    {
        $t

 Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the backward compatibility promise for PHPUnit
 */
final readonly class ExecutionStartedSubscriber ex


es=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\GarbageCollection;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the backward compatibility promise for PHPUnit
 */
abstract readonly class Subscribe

e GarbageCollectionHandler $handler;

    public function __construct(GarbageCollectionHandler $handler)
    {
        $this->handler = $handler;
    }

    protected function handler(): GarbageCollectionHandler
    {
        return $this->handler;
    }
}


n <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\GarbageCollection;

use PHPUnit\Event\InvalidArgumentException;
use PHPUnit\Event\Test\Finished;
use PHPUnit\Event\Test\FinishedSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the backward compatibility promis

ubscriber extends Subscriber implements FinishedSubscriber
{
    /**
     * @throws \PHPUnit\Framework\InvalidArgumentException
     * @throws InvalidArgumentException
     */
    public function notify(Finished $event): void
    {
        $this->handler()

e for PHPUnit
 */
final readonly class TestFinishedS


e(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
if (!defined('TEST_FILES_PATH')) {
    define('TEST_FILES_PATH', __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR);
}

$composer = file_exists(__DIR__ . '/../vendor/autoload.php');
$phar     = file_exists(__DIR__ . '/autoload.php');

if ($composer && $phar)

composer) {
    if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
        define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__) . '/vendor/autoload.php');
    }

    require_once __DIR__ . '/../vendor/autoload.php';
}

if ($phar) {
    if (!defined('__PHPUNIT_PHAR

 {
    print 'More than one test fixture autoloader is available, exiting.' . PHP_EOL;

    exit(1);
}

if (!$composer && !$phar) {
    print 'No test fixture autoloader was registered, exiting.' . PHP_EOL;

    exit(1);
}

if ($


e(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;

abstract class AbstractVariousIterableDataProviderTest
{
    public static function asArrayProviderInParent()
    {
        return [
            ['J'],
            ['K'],
            ['L'],

n new WrapperIteratorAggregate([
            ['P'],
            ['Q'],
            ['R'],
        ]);
    }

    abstract public static function asArrayProvider();

    abstract public static function asIteratorProvider();

    abstract public static funct

       ];
    }

    public static function asIteratorProviderInParent()
    {
        yield ['M'];

        yield ['N'];

        yield ['O'];
    }

    public static function asTraversableProviderInParent()
    {
        retur


s=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

final class BankAccount
{
    /**
     * The bank account's balance.
     *
     * @var float
     */
    private $balance = 0;

    /**
     * Returns the bank account's balance.
     *
     * @return float
     */
    public function getBalance()

ance)
    {
        $this->setBalance($this->getBalance() + $balance);

        return $this->getBalance();
    }

    /**
     * Withdraws an amount of money from the bank account.
     *
     * @param float $balance
     *
     * @throws BankAccountExcep

 {
        return $this->balance;
    }

    /**
     * Deposits an amount of money to the bank account.
     *
     * @param float $balance
     *
     * @throws BankAccountException
     */
    public function depositMoney($bal


s=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\CoversFunction;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

#[CoversFunction(BankAccount::class)]
final class BankAccountTest extends TestCase
{
    #[Group('balanceIsInitiallyZero')]
    #[

    $balance = $ba->getBalance();

        /* @Then I should get 0 */
        $this->assertEquals(0, $balance);
    }

    #[Group('balanceCannotBecomeNegative')]
    #[Group('specification')]
    public function testBalanceCannotBecomeNegative(): void

Group('specification')]
    #[Group('1234')]
    public function testBalanceIsInitiallyZero(): void
    {
        /* @Given a fresh bank account */
        $ba = new BankAccount;

        /* @When I ask it for its balance */


 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

final class ClassWithNonPublicAttributes extends ParentClassWithProtectedAttributes
{
    public static $publicStaticAttribute       = 'foo';
    protected static $protectedStaticAttribute = 'bar';
    protected static $privateStaticAttribute   = 'baz';
    public $publicAttribute

        = 1;
    public $bar                                = 2;
    public $publicArray                        = ['foo'];
    protected $protectedAttribute              = 'bar';
    protected $privateAttribute                = 'baz';
    protected $protec


 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\TestCase;

final class DataProviderDependencyResultTest extends TestCase
{
    public static function providerMethod(): array
    {
        return [
            [0, 2],
            [1, 1

}

    #[DataProvider('providerMethod')]
    #[Depends('testDependency')]
    public function testAdd($a, $b, $c): void
    {
        $this->assertSame(2, $c);
        $this->assertSame($c, $a + $b);
    }

    public function testDependency(): int
    {


 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\Attributes\Ticket;
use PHPUnit\Framework\TestCase;

final class DataProviderDependencyTest extends TestCase
{
    public static function provider(): array
    {
        self::markTestSki

pped.');
    }

    public function testReference(): void
    {
        $this->markTestSkipped('This test should be skipped.');
    }

    #[Depends('testReference')]
    #[DataProvider('provider')]
    #[Ticket('https://github.com/sebastianbergmann/phpuni

pped('Any test with this data provider should be ski


n <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\TestCase;

final class DataProviderDependencyVoidTest extends TestCase
{
    public static function provider(): iterable
    {
        return [
            [0, 0],
            [1, 'b' => 1],
            ['a'

],
        ];
    }

    #[DataProvider('provider')]
    #[Depends('testDependency')]
    public function testEquality($a, $b): void
    {
        $this->assertSame($a, $b);
    }

    public function testDependency(): void
    {
        $this->assertTrue(


declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class DataProviderExecutionOrderTest extends TestCase
{
    public static function dataProviderAdditions(): array
    {
        return [

er('dataProviderAdditions')]
    public function testAddNumbersWithDataProvider(int $a, int $b, int $sum): void
    {
        $this->assertSame($sum, $a + $b);
    }

    public function testTestInTheMiddleThatAlwaysWorks(): void
    {
        $this->asser

  '1+2=3' => [1, 2, 3],
            '2+1=3' => [2, 1, 3],
            '1+1=3' => [1, 1, 3],
        ];
    }

    public function testFirstTestThatAlwaysWorks(): void
    {
        $this->assertTrue(true);
    }

    #[DataProvid


hp declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class DataProviderFilterTest extends TestCase
{
    public static function truthProvider(): array
    {
        return [
            [true],

alse],
            'other false test'  => [false],
            'other false test2' => [false],
        ];
    }

    #[DataProvider('truthProvider')]
    public function testTrue($truth): void
    {
        $this->assertTrue($truth);
    }

    #[DataProvi

         [true],
            [true],
            [true],
        ];
    }

    public static function falseProvider(): array
    {
        return [
            'false test'        => [false],
            'false test 2'      => [f


 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class DataProviderIncompleteTest extends TestCase
{
    public static function providerMethod(): array
    {
        return [
            [0, 0, 0],
            [0, 1, 1],
        ];
    }

    public static fun

      self::markTestIncomplete('incomplete');
    }

    #[DataProvider('incompleteTestProviderMethod')]
    public function testIncomplete($a, $b, $c): void
    {
        $this->assertTrue(true);
    }

    #[DataProvider('providerMethod')]
    public fun

ction incompleteTestProviderMethod(): array
    {


s=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use Exception;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\DataProviderExternal;
use PHPUnit\Framework\Attributes\RequiresPhpunit;
use PHPUnit\Framework\TestCase;

final class DataProviderRequiresPhpUnitTest extends

 }

    public function invalidProvider(): array
    {
        return [[true], [true]];
    }

    #[RequiresPhpunit('< 10.0.0')]
    #[DataProvider('invalidProvider')]
    public function testWithInvalidDataProvider(bool $param): void
    {
        $this-

TestCase
{
    public static function providerThatThrows(): array
    {
        throw new Exception('Should have been skipped.');
    }

    public static function validProvider(): array
    {
        return [[true], [true]];


 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class DataProviderSkippedTest extends TestCase
{
    public static function providerMethod()
    {
        return [
            [0, 0, 0],
            [0, 1, 1],
        ];
    }

    public static function skip

arkTestSkipped('skipped');
    }

    #[DataProvider('skippedTestProviderMethod')]
    public function testSkipped($a, $b, $c): void
    {
        $this->assertTrue(true);
    }

    #[DataProvider('providerMethod')]
    public function testAdd($a, $b, $c)

pedTestProviderMethod(): array
    {
        self::m


hp declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class DataProviderTooManyArgumentsNoValidationTest extends TestCase
{
    public static function provider(): iterable
    {
        // correct c

taProvider('provider', false)]
    public function testMethodHavingTwoParameters(bool $x1, bool $x2 = true): void
    {
        $this->assertSame($x1, $x2);
    }

    #[DataProvider('provider')]
    public function testMethodHavingVariadicParameter(bool $

ase, 2nd parameter is not required
        yield [true];

        // correct case
        yield [true, true];

        // incorrect case
        yield [true, true, 'Third argument, but test method only has two.'];
    }

    #[Da


declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class DataProviderTooManyArgumentsTest extends TestCase
{
    public static function provider(): iterable
    {
        // correct case, 2nd parame

vider')]
    public function testMethodHavingTwoParameters(bool $x1, bool $x2 = true): void
    {
        $this->assertSame($x1, $x2);
    }

    #[DataProvider('provider')]
    public function testMethodHavingVariadicParameter(bool $x1, ...$rest): void

ter is not required
        yield [true];

        // correct case
        yield [true, true];

        // incorrect case
        yield [true, true, 'Third argument, but test method only has two.'];
    }

    #[DataProvider('pro


es=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class DataProviderWithStringKeysTest extends TestCase
{
    public static function providerMethod(): array
    {
        return [
            '0 + 0 = 0' => [0, 0, 0


re(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class DuplicateKeyDataProvidersTest extends TestCase
{
    public static function dataProvider1(): iterable
    {
        return [
            'bar' =>

taProvider2(): iterable
    {
        return [
            'bar' => [2],
        ];
    }

    #[DataProvider('dataProvider1')]
    #[DataProvider('dataProvider2')]
    public function test($value): void
    {
        $this->assertSame(2, $value);
    }
}

[1],
        ];
    }

    public static function da


declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use Exception;
use InvalidArgumentException;
use PHPUnit;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Framework\TestCase;

final class ExceptionStackTest extends TestCase
{
    public function testPrintingChildExcep

  throw new PHPUnit\Framework\Exception("Child exception\n{$message}", 101, $e);
        }
    }

    public function testNestedExceptions(): void
    {
        $exceptionThree = new Exception('Three');
        $exceptionTwo   = new InvalidArgumentExceptio

tion(): void
    {
        try {
            $this->assertEquals([1], [2], 'message');
        } catch (ExpectationFailedException $e) {
            $message = $e->getMessage() . $e->getComparisonFailure()->getDiff();


n <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

class FaillingDataProviderTest extends TestCase
{
    public static function provideData(): array
    {
        return [
            'good1' => [3, 1, 2],
            'good2' => [5, 2, 3],
            'fail1' => [10, 3, 4],
            'good

        ];
    }

    public function testOne(): void
    {
        $this->assertTrue(true);
    }

    #[DataProvider('provideData')]
    public function testWithProvider($sum, $summand, $summmand2): void
    {
        $this->assertSame($sum, $summand +


art of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\TestCase;
use stdClass;

final class FailureTest extends TestCase
{
    public function testAssertArrayEqualsArray(): void
    {
        $this->assertEquals([1], [2], 'message');
    }

    public function testAssertIntegerEqualsInteger(): void
    {

      $this->assertEquals($a, $b, 'message');
    }

    public function testAssertNullEqualsString(): void
    {
        $this->assertEquals(null, 'bar', 'message');
    }

    public function testAssertStringEqualsString(): void
    {
        $this->asse

   $this->assertEquals(1, 2, 'message');
    }

    public function testAssertObjectEqualsObject(): void
    {
        $a      = new stdClass;
        $a->foo = 'bar';

        $b      = new stdClass;
        $b->bar = 'foo';


s=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use function ini_get;
use function ini_set;
use PHPUnit\Framework\Attributes\PreserveGlobalState;
use PHPUnit\Framework\TestCase;

final class IniSettingNotChangeableAtRuntimeTest extends TestCase
{
    #[PreserveGlobalState(true)]
    public function

d
        // below was not set by the test (or PHPUnit) inside the child process,
        // but can only have been forwarded as a command line option by PHPUnit
        // when it spawned the child process for this isolated test.
        $this->assertFals

testIniSettingNotChangeableAtRuntimeIsForwardedToChildProcess(): void
    {
        // max_input_time is PHP_INI_PERDIR and therefore cannot be changed
        // using ini_set() at runtime. This guarantees that the value asserte


?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\Attributes\DependsExternal;
use PHPUnit\Framework\TestCase;

class MultiDependencyTest extends TestCase
{
    public function testOne()
    {
        $this->assertT

: void
    {
        $this->assertEquals('foo', $a);
        $this->assertEquals('bar', $b);
    }

    #[DependsExternal(self::class, 'testThree')]
    public function testFour(): void
    {
        $this->assertTrue(true);
    }

    public function test

rue(true);

        return 'foo';
    }

    public function testTwo()
    {
        $this->assertTrue(true);

        return 'bar';
    }

    #[Depends('testOne')]
    #[Depends('testTwo')]
    public function testThree($a, $b)


s=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use ArrayIterator;
use ArrayObject;
use Generator;
use Iterator;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class MultipleDataProviderTest extends TestCase
{
    public static function providerA(): array
    {

l],
            [null, 'ok', null],
            [null, 'ok', null],
        ];
    }

    public static function providerC(): array
    {
        return [
            [null, null, 'ok'],
            [null, null, 'ok'],
            [null, null, 'ok'],

        return [
            ['ok', null, null],
            ['ok', null, null],
            ['ok', null, null],
        ];
    }

    public static function providerB(): array
    {
        return [
            [null, 'ok', nul


n <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\TestCase;

final class OutputTest extends TestCase
{
    public function testExpectOutputStringFooActualFoo(): void
    {
        $this->expectOutputString('foo');
        print 'foo';
    }

    public function testExpectOutputStringFooActualBar(): void
    {
        $this->expectOutputString('foo

testExpectOutputRegexFooActualFoo(): void
    {
        $this->expectOutputRegex('/foo/');
        print 'foo';
    }

    public function testExpectOutputRegexFooActualBar(): void
    {
        $this->expectOutputRegex('/foo/');
        print 'bar';
    }

');
        print 'bar';
    }

    public function


pes=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use function count;
use function end;
use PHPUnit\Event;

abstract class RecordingSubscriber
{
    /**
     * @var array<int, Event\Event>
     */
    private array $events = [];

    final public function recordedEventCount(): int
    {
        retu

ction lastRecordedEvent(): ?Event\Event
    {
        if ([] === $this->events) {
            return null;
        }

        return end($this->events);
    }

    final protected function record($event): void
    {
        $this->events[] = $event;
    }

rn count($this->events);
    }

    final public fun


tributes\RequiresOperatingSystem;
use PHPUnit\Framework\Attributes\RequiresOperatingSystemFamily;
use PHPUnit\Framework\Attributes\RequiresPhp;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\Attributes\RequiresPhpunit;
use PHPUnit\Framework\Attributes\RequiresPhpunitExtension;
use PHPUnit\Framework\Attributes\RequiresSetting;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\Attributes\Ticket;
use PHPUnit\Framework\TestCase;
use ReflectionMethod;

final class Requ

void
    {
    }

    #[RequiresPhpunit('>= 2.0.0')]
    #[RequiresPhp('>= 1.0.0')]
    public function testFour(): void
    {
    }

    #[RequiresPhp('5.4.0RC6')]
    public function testFive(): void
    {
    }

    #[RequiresPhp('5.4.0-alpha1')]
    pu

irementsTest extends TestCase
{
    public function testOne(): void
    {
    }

    #[RequiresPhpunit('>= 1.0.0')]
    public function testTwo(): void
    {
    }

    #[RequiresPhp('>= 2.0.0')]
    public function testThree():


is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\TestRunner\Issue\NoticeTriggered;
use PHPUnit\Event\TestRunner\Issue\NoticeTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covere

 */
final readonly class TestRunnerTriggeredIssueNoticeSubscriber extends Subscriber implements NoticeTriggeredSubscriber
{
    public function notify(NoticeTriggered $event): void
    {
        $this->collector()->testRunnerTriggeredIssueNotice($event);


* This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\TestRunner\PhpDeprecationTriggered;
use PHPUnit\Event\TestRunner\PhpDeprecationTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This cla

ise for PHPUnit
 */
final readonly class TestRunnerTriggeredIssuePhpDeprecationSubscriber extends Subscriber implements PhpDeprecationTriggeredSubscriber
{
    public function notify(PhpDeprecationTriggered $event): void
    {
        $this->collector()->t

ss is not covered by the backward compatibility prom


is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\TestRunner\Issue\WarningTriggered;
use PHPUnit\Event\TestRunner\Issue\WarningTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not cove

t
 */
final readonly class TestRunnerTriggeredIssueWarningSubscriber extends Subscriber implements WarningTriggeredSubscriber
{
    public function notify(WarningTriggered $event): void
    {
        $this->collector()->testRunnerTriggeredIssueWarning($eve


ict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\TestRunner\NoticeTriggered;
use PHPUnit\Event\TestRunner\NoticeTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This c

omise for PHPUnit
 */
final readonly class TestRunnerTriggeredPhpunitNoticeSubscriber extends Subscriber implements NoticeTriggeredSubscriber
{
    public function notify(NoticeTriggered $event): void
    {
        $this->collector()->testRunnerTriggeredPh

lass is not covered by the backward compatibility pr


es=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\TestSuite\Finished;
use PHPUnit\Event\TestSuite\FinishedSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by

ompatibility promise for PHPUnit
 */
final readonly class TestSuiteFinishedSubscriber extends Subscriber implements FinishedSubscriber
{
    public function notify(Finished $event): void
    {
        $this->collector()->testSuiteFinished($event);
    }
}


ict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\DeprecationTriggered;
use PHPUnit\Event\Test\DeprecationTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This cla

ise for PHPUnit
 */
final readonly class TestTriggeredDeprecationSubscriber extends Subscriber implements DeprecationTriggeredSubscriber
{
    public function notify(DeprecationTriggered $event): void
    {
        $this->collector()->testTriggeredDeprecat


p declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\NoticeTriggered;
use PHPUnit\Event\Test\NoticeTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This

romise for PHPUnit
 */
final readonly class TestTriggeredNoticeSubscriber extends Subscriber implements NoticeTriggeredSubscriber
{
    public function notify(NoticeTriggered $event): void
    {
        $this->collector()->testTriggeredNotice($event);

class is not covered by the backward compatibility p


pes=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\PhpNoticeTriggered;
use PHPUnit\Event\Test\PhpNoticeTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not

PUnit
 */
final readonly class TestTriggeredPhpNoticeSubscriber extends Subscriber implements PhpNoticeTriggeredSubscriber
{
    public function notify(PhpNoticeTriggered $event): void
    {
        $this->collector()->testTriggeredPhpNotice($event);
    }


ict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\PhpWarningTriggered;
use PHPUnit\Event\Test\PhpWarningTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class

e for PHPUnit
 */
final readonly class TestTriggeredPhpWarningSubscriber extends Subscriber implements PhpWarningTriggeredSubscriber
{
    public function notify(PhpWarningTriggered $event): void
    {
        $this->collector()->testTriggeredPhpWarning($e

is not covered by the backward compatibility promis


is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\PhpunitNoticeTriggered;
use PHPUnit\Event\Test\PhpunitNoticeTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the b

readonly class TestTriggeredPhpunitNoticeSubscriber extends Subscriber implements PhpunitNoticeTriggeredSubscriber
{
    public function notify(PhpunitNoticeTriggered $event): void
    {
        $this->collector()->testTriggeredPhpunitNotice($event);
    }

ackward compatibility promise for PHPUnit
 */
final


re(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\WarningTriggered;
use PHPUnit\Event\Test\WarningTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class

e for PHPUnit
 */
final readonly class TestTriggeredWarningSubscriber extends Subscriber implements WarningTriggeredSubscriber
{
    public function notify(WarningTriggered $event): void
    {
        $this->collector()->testTriggeredWarning($event);
    }


is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\TestRunner\PhpNoticeTriggered;
use PHPUnit\Event\TestRunner\PhpNoticeTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by t

nal readonly class TestRunnerTriggeredIssuePhpNoticeSubscriber extends Subscriber implements PhpNoticeTriggeredSubscriber
{
    public function notify(PhpNoticeTriggered $event): void
    {
        $this->collector()->testRunnerTriggeredIssuePhpNotice($eve

he backward compatibility promise for PHPUnit
 */
fi


* This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\TestRunner\DeprecationTriggered;
use PHPUnit\Event\TestRunner\DeprecationTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is

r PHPUnit
 */
final readonly class TestRunnerTriggeredPhpunitDeprecationSubscriber extends Subscriber implements DeprecationTriggeredSubscriber
{
    public function notify(DeprecationTriggered $event): void
    {
        $this->collector()->testRunnerTrig


p declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\ConsideredRisky;
use PHPUnit\Event\Test\ConsideredRiskySubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This

romise for PHPUnit
 */
final readonly class TestConsideredRiskySubscriber extends Subscriber implements ConsideredRiskySubscriber
{
    public function notify(ConsideredRisky $event): void
    {
        $this->collector()->testConsideredRisky($event);


is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\TestRunner\WarningTriggered;
use PHPUnit\Event\TestRunner\WarningTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the b

readonly class TestRunnerTriggeredPhpunitWarningSubscriber extends Subscriber implements WarningTriggeredSubscriber
{
    public function notify(WarningTriggered $event): void
    {
        $this->collector()->testRunnerTriggeredPhpunitWarning($event);


 declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\TestSuite\Started;
use PHPUnit\Event\TestSuite\StartedSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class i

by the backward compatibility promise for PHPUnit
 */
final readonly class TestSuiteStartedSubscriber extends Subscriber implements StartedSubscriber
{
    public function notify(Started $event): void
    {
        $this->collector()->testSuiteStarted($eve


is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\PhpDeprecationTriggered;
use PHPUnit\Event\Test\PhpDeprecationTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the

l readonly class TestTriggeredPhpDeprecationSubscriber extends Subscriber implements PhpDeprecationTriggeredSubscriber
{
    public function notify(PhpDeprecationTriggered $event): void
    {
        $this->collector()->testTriggeredPhpDeprecation($event);

 backward compatibility promise for PHPUnit
 */
fina


ict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\PhpunitErrorTriggered;
use PHPUnit\Event\Test\PhpunitErrorTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This c

omise for PHPUnit
 */
final readonly class TestTriggeredPhpunitErrorSubscriber extends Subscriber implements PhpunitErrorTriggeredSubscriber
{
    public function notify(PhpunitErrorTriggered $event): void
    {
        $this->collector()->testTriggeredPhp


s=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Runner\GarbageCollection;

use function gc_collect_cycles;
use function gc_disable;
use function gc_enable;
use PHPUnit\Event\Facade;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This c

nction __construct(Facade $facade, int $threshold)
    {
        $this->facade    = $facade;
        $this->threshold = $threshold;

        $this->registerSubscribers();
    }

    public function executionStarted(): void
    {
        gc_disable();

lass is not covered by the backward compatibility promise for PHPUnit
 */
final class GarbageCollectionHandler
{
    private readonly Facade $facade;
    private readonly int $threshold;
    private int $tests = 0;

    public fu


* This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\TestRunner\PhpWarningTriggered;
use PHPUnit\Event\TestRunner\PhpWarningTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is no

PHPUnit
 */
final readonly class TestRunnerTriggeredIssuePhpWarningSubscriber extends Subscriber implements PhpWarningTriggeredSubscriber
{
    public function notify(PhpWarningTriggered $event): void
    {
        $this->collector()->testRunnerTriggeredIs


re(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\MarkedIncomplete;
use PHPUnit\Event\Test\MarkedIncompleteSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class

e for PHPUnit
 */
final readonly class TestMarkedIncompleteSubscriber extends Subscriber implements MarkedIncompleteSubscriber
{
    public function notify(MarkedIncomplete $event): void
    {
        $this->collector()->testMarkedIncomplete($event);
    }


php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\ErrorTriggered;
use PHPUnit\Event\Test\ErrorTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This

romise for PHPUnit
 */
final readonly class TestTriggeredErrorSubscriber extends Subscriber implements ErrorTriggeredSubscriber
{
    public function notify(ErrorTriggered $event): void
    {
        $this->collector()->testTriggeredError($event);
    }
}


is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\PhpunitWarningTriggered;
use PHPUnit\Event\Test\PhpunitWarningTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is not covered by the

l readonly class TestTriggeredPhpunitWarningSubscriber extends Subscriber implements PhpunitWarningTriggeredSubscriber
{
    public function notify(PhpunitWarningTriggered $event): void
    {
        $this->collector()->testTriggeredPhpunitWarning($event);


?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\Finished;
use PHPUnit\Event\Test\FinishedSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class is no

he backward compatibility promise for PHPUnit
 */
final readonly class TestFinishedSubscriber extends Subscriber implements FinishedSubscriber
{
    public function notify(Finished $event): void
    {
        $this->collector()->testFinished($event);
    }


* This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\Test\PhpunitDeprecationTriggered;
use PHPUnit\Event\Test\PhpunitDeprecationTriggeredSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class i

for PHPUnit
 */
final readonly class TestTriggeredPhpunitDeprecationSubscriber extends Subscriber implements PhpunitDeprecationTriggeredSubscriber
{
    public function notify(PhpunitDeprecationTriggered $event): void
    {
        $this->collector()->test

s not covered by the backward compatibility promise


 declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestRunner\TestResult;

use PHPUnit\Event\TestSuite\Skipped;
use PHPUnit\Event\TestSuite\SkippedSubscriber;

/**
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
 *
 * @internal This class i

by the backward compatibility promise for PHPUnit
 */
final readonly class TestSuiteSkippedSubscriber extends Subscriber implements SkippedSubscriber
{
    public function notify(Skipped $event): void
    {
        $this->collector()->testSuiteSkipped($eve


hp declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Metadata\Attribute;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\CoversClassesThatExtendClass;
use PHPUnit\Framework\Attributes\CoversClassesThatImplementInterface;
use PHPUnit\Framework\Attributes

re\Metadata\Attribute')]
#[CoversClass(Example::class)]
#[CoversClassesThatExtendClass(Example::class)]
#[CoversClassesThatImplementInterface(Example::class)]
#[CoversTrait(ExampleTrait::class)]
#[CoversMethod(Example::class, 'method')]
#[CoversFunction('f

\CoversFunction;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\CoversNamespace;
use PHPUnit\Framework\Attributes\CoversTrait;
use PHPUnit\Framework\TestCase;

#[CoversNamespace('PHPUnit\TestFixtu


s=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Metadata\Attribute;

use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\Attributes\DependsExternal;
use PHPUnit\Framework\Attributes\DependsExternalUsingDeepClone;
use PHPUnit\Framework\Attributes\DependsExternalUsingShallowClone;
use PHPUni

HPUnit\Framework\Attributes\DependsUsingShallowClone;
use PHPUnit\Framework\TestCase;

final class DependencyTest extends TestCase
{
    #[Depends('testOne')]
    public function testOne(): void
    {
    }

    #[DependsUsingDeepClone('testOne')]
    publ

t\Framework\Attributes\DependsOnClass;
use PHPUnit\Framework\Attributes\DependsOnClassUsingDeepClone;
use PHPUnit\Framework\Attributes\DependsOnClassUsingShallowClone;
use PHPUnit\Framework\Attributes\DependsUsingDeepClone;
use P


declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Basic;

use Exception;
use PHPUnit\Framework\TestCase;

/**
 * Class SetUpBeforeClassTest.
 *
 * Behaviour to test:
 * - setUpBeforeClass() errors do reach the user
 * - setUp() is not run
 * - how many times is setUpBeforeClass() call

 */
class SetUpBeforeClassTest extends TestCase
{
    public static function setUpBeforeClass(): void
    {
        throw new Exception('forcing an Exception in setUpBeforeClass()');
    }

    protected function setUp(): void
    {
        throw new Exce

ed?
 * - tests are not executed
 *
 * @see https://github.com/sebastianbergmann/phpunit/issues/2145
 * @see https://github.com/sebastianbergmann/phpunit/issues/3107
 * @see https://github.com/sebastianbergmann/phpunit/issues/3364


<?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Basic;

use PHPUnit\Framework\TestCase;
use RuntimeException;

/**
 * Class SetUpBeforeClassTest.
 *
 * Behaviour to test:
 * - setUp() errors reach the user
 * - how many times is setUp() called?
 * - tests are not executed
 *

RuntimeException('throw exception in setUp');
    }

    public function testOneWithSetUpException(): void
    {
        $this->assertTrue(false);
    }

    public function testTwoWithSetUpException(): void
    {
        $this->assertTrue(false);
    }
}

* @see https://github.com/sebastianbergmann/phpunit/issues/3107
 * @see https://github.com/sebastianbergmann/phpunit/issues/3364
 */
class SetUpTest extends TestCase
{
    protected function setUp(): void
    {
        throw new


art of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Basic;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\RequiresPhp;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use PHPUnit\TestFixture\MockObject\AnInterface;
use RuntimeExc

:class);

        $this->assertTrue(true);
    }

    public function testFailure(): void
    {
        $this->assertTrue(false);
    }

    public function testError(): void
    {
        throw new RuntimeException;
    }

    public function testIncomple

eption;

#[CoversClass('Foo')]
#[UsesClass('Bar')]
#[TestDox('Test result status with and without message')]
class StatusTest extends TestCase
{
    public function testSuccess(): void
    {
        $this->createMock(AnInterface:


* This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Basic;

use Exception;
use PHPUnit\Framework\TestCase;

/**
 * Class TearDownAfterClassTest.
 *
 * Behaviour to test:
 * - tearDownAfterClass() errors do reach the user
 * - tests are executed
 * - tearDownAfterClass() should be called and reported once
 */
class

 static function tearDownAfterClass(): void
    {
        throw new Exception('forcing an Exception in tearDownAfterClass()');
    }

    public function testOne(): void
    {
        $this->assertTrue(true);
    }

    public function testTwo(): void

TearDownAfterClassTest extends TestCase
{
    public


es=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\requires_environment_variable;

use PHPUnit\Framework\Attributes\RequiresEnvironmentVariable;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use PHPUnit\Framework\TestCase;

final class SomeTest extends TestCase
{
    #[RequiresEnvironmentVariab

is->fail();
    }

    #[RequiresEnvironmentVariable('BAZ')]
    public function testShouldNotRunBAZDoesNotExist(): void
    {
        $this->fail();
    }

    #[RequiresEnvironmentVariable('FOO')]
    public function testOneShouldRun(): void
    {

le('FOO', 'bar')]
    public function testShouldNotRunFOOHasWrongValue(): void
    {
        $this->fail();
    }

    #[RequiresEnvironmentVariable('BAR')]
    public function testShouldNotRunBARIsEmpty(): void
    {
        $th


es=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\requires_environment_variable;

use function getenv;
use PHPUnit\Framework\Attributes\WithEnvironmentVariable;
use PHPUnit\Framework\TestCase;

#[WithEnvironmentVariable('FOO', 'foo')]
final class WithEnvironmentVariableHookTest extends TestCase
{
    p

ultValues();
    }

    protected function setUp(): void
    {
        $this->assertEnvironmentVariablesHaveCustomValues();
    }

    protected function tearDown(): void
    {
        $this->assertEnvironmentVariablesHaveCustomValues();
    }

    #[WithE

ublic static function setUpBeforeClass(): void
    {
        self::assertEnvironmentVariablesHaveDefaultValues();
    }

    public static function tearDownAfterClass(): void
    {
        self::assertEnvironmentVariablesHaveDefa


stian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\requires_environment_variable;

use function getenv;
use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\Attributes\RequiresEnvironmentVariable;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use PHPUnit\Framework\Attributes\WithEnvironmentVariable;
use PHPUnit\Framework\TestCase;

#[WithEnvironmentVariable('

 getenv('FOO'));
    }

    #[WithEnvironmentVariable('FOO', 'bar')]
    public function testFOOShouldHaveValueOverriddenFromMethodAttribute(): void
    {
        $this->assertSame('bar', $_ENV['FOO']);
        $this->assertSame('bar', getenv('FOO'));

FOO', 'foo')]
final class WithEnvironmentVariableTest extends TestCase
{
    public function testFOOShouldHaveValueFromClassAttribute1(): void
    {
        $this->assertSame('foo', $_ENV['FOO']);
        $this->assertSame('foo',


declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\LogEventsText;

use function fopen;
use PHPUnit\Framework\TestCase;
use stdClass;

final class Test extends TestCase
{
    public function testExportNull(): void
    {
        $this->assertNull(null);
    }

    public function testExp

o, world!', 'hello, world!');
    }

    public function testExportArray(): void
    {
        $arr = [1, 'foo' => 2];
        $this->assertSame($arr, $arr);
    }

    public function testExportObject(): void
    {
        $this->assertSame(new stdClass,

ortBool(): void
    {
        $this->assertTrue(true);
    }

    public function testExportInt(): void
    {
        $this->assertSame(1, 1);
    }

    public function testExportStr(): void
    {
        $this->assertSame('hell


s=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\DoNotFailOn;

use const E_USER_DEPRECATED;
use const E_USER_NOTICE;
use const E_USER_WARNING;
use function trigger_error;
use PHPUnit\Event\Facade as EventFacade;
use PHPUnit\Framework\TestCase;

final class IssueTest extends TestCase
{
    public functi

   }

    public function testThatTriggersPhpunitWarning(): void
    {
        EventFacade::emitter()->testTriggeredPhpunitWarning(
            $this->valueObjectForEvents(),
            'message',
        );

        $this->assertTrue(true);
    }

    pu

on testThatTriggersPhpunitDeprecation(): void
    {
        EventFacade::emitter()->testTriggeredPhpunitDeprecation(
            $this->valueObjectForEvents(),
            'message',
        );

        $this->assertTrue(true);


s=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\AttributesOnTemplateMethods;

use PHPUnit\Framework\Attributes\After;
use PHPUnit\Framework\Attributes\AfterClass;
use PHPUnit\Framework\Attributes\Before;
use PHPUnit\Framework\Attributes\BeforeClass;
use PHPUnit\Framework\Attributes\PostCondition;
use

ction before_class(): void
    {
    }

    #[AfterClass]
    #[Test]
    public static function after_class(): void
    {
    }

    #[Test]
    public static function setUpBeforeClass(): void
    {
    }

    #[Test]
    public static function tearDownAf

PHPUnit\Framework\Attributes\PreCondition;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

final class TestAttributeOnHookMethodsTest extends TestCase
{
    #[BeforeClass]
    #[Test]
    public static fun


n <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\TestRunnerStopping;

use const E_USER_DEPRECATED;
use function trigger_error;
use PHPUnit\Event\Facade as EventFacade;
use PHPUnit\Framework\TestCase;

final class DeprecationTest extends TestCase
{
    public function testOne(): void
    {
        trigger_error('message', E_USER_DEPRECATED);

        $this->assertTrue(tr

{
        $this->assertTrue(true);
    }

    public function testThree(): void
    {
        $this->assertTrue(true);

        EventFacade::emitter()->testTriggeredPhpunitDeprecation(
            $this->valueObjectForEvents(),
            'message',

ue);
    }

    public function testTwo(): void


php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\TestRunnerStopping;

use const SIGINT;
use function posix_getppid;
use function posix_kill;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use PHPUnit\Framework\TestCase;

final class InterruptProcessIsolationTest extends T

#[RunInSeparateProcess]
    public function testOne(): void
    {
        $this->assertTrue(true);

        posix_kill(posix_getppid(), SIGINT);
    }

    #[RunInSeparateProcess]
    public function testTwo(): void
    {
        $this->assertTrue(true);


pes=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\TestRunnerStopping;

use const E_USER_WARNING;
use function trigger_error;
use Exception;
use PHPUnit\Framework\TestCase;

final class MultipleDefectTest extends TestCase
{
    public function testOne(): void
    {
        $this->assertTrue(false);

  throw new Exception('message');
    }

    public function testThree(): void
    {
        trigger_error('message', E_USER_WARNING);

        $this->assertTrue(true);
    }

    public function testFour(): void
    {
        $this->assertTrue(true);

 }

    public function testTwo(): void
    {


n <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\TestRunnerStopping;

use const E_USER_NOTICE;
use function trigger_error;
use PHPUnit\Framework\TestCase;

final class MultipleNoticeTest extends TestCase
{
    public function testOne(): void
    {
        trigger_error('message', E_USER_NOTICE);

        $this->assertTrue(true);
    }

    public function testTwo(): voi

CE);

        $this->assertTrue(true);
    }

    public function testThree(): void
    {
        trigger_error('message', E_USER_NOTICE);

        $this->assertTrue(true);
    }

    public function testFour(): void
    {
        $this->assertTrue(true);


n <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\TestRunnerStopping;

use const E_USER_WARNING;
use function trigger_error;
use PHPUnit\Framework\TestCase;

final class MultipleWarningTest extends TestCase
{
    public function testOne(): void
    {
        trigger_error('message', E_USER_WARNING);

        $this->assertTrue(true);
    }

    public function testTwo():

ARNING);

        $this->assertTrue(true);
    }

    public function testThree(): void
    {
        trigger_error('message', E_USER_WARNING);

        $this->assertTrue(true);
    }

    public function testFour(): void
    {
        $this->assertTrue(tr


ict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\TestRunnerStopping;

use const E_USER_DEPRECATED;
use function trigger_error;
use PHPUnit\Framework\TestCase;

final class SpecificDeprecationTest extends TestCase
{
    public function testOne(): void
    {
        trigger_error('...foo...', E_U

   }

    public function testTwo(): void
    {
        trigger_error('...bar...', E_USER_DEPRECATED);

        $this->assertTrue(true);
    }

    public function testThree(): void
    {
        trigger_error('...baz...', E_USER_DEPRECATED);

        $thi


n <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\TestRunnerStopping;

use const E_USER_DEPRECATED;
use function trigger_error;
use PHPUnit\Framework\TestCase;

final class SuppressedDeprecationTest extends TestCase
{
    public function testOne(): void
    {
        @trigger_error('suppressed message', E_USER_DEPRECATED);

        $this->assertTrue(true);
    }

    pub

sertTrue(true);
    }

    public function testThree(): void
    {
        trigger_error('non-suppressed message', E_USER_DEPRECATED);

        $this->assertTrue(true);
    }

    public function testFour(): void
    {
        $this->assertTrue(true);

lic function testTwo(): void
    {
        $this->as


 declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\DataProvider;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class DuplicateKeyAcrossProvidersTest extends TestCase
{
    public static function providerA(): array
    {
        return ['shared'

}

    public static function providerB(): array
    {
        return ['shared' => [2]];
    }

    #[DataProvider('providerA')]
    #[DataProvider('providerB')]
    public function testOne(int $value): void
    {
        $this->assertGreaterThan(0, $value


s=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Baseline;

use const E_USER_DEPRECATED;
use const E_USER_NOTICE;
use const E_USER_WARNING;
use function trigger_error;
use Serializable;

final class Source
{
    public function triggerDeprecation(): void
    {
        $this->deprecation();
    }

    p

hpDeprecation();
    }

    public function triggerPhpNoticeAndWarning(): void
    {
        $this->phpNoticeAndWarning();
    }

    private function deprecation(): void
    {
        @trigger_error('deprecation', E_USER_DEPRECATED);
    }

    private fu

ublic function triggerNotice(): void
    {
        $this->notice();
    }

    public function triggerWarning(): void
    {
        $this->warning();
    }

    public function triggerPhpDeprecation(): void
    {
        $this->p


?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Baseline;

use PHPUnit\Framework\TestCase;

final class Test extends TestCase
{
    public function testDeprecation(): void
    {
        (new Source)->triggerDeprecation();

        $this->assertTrue(true);
    }

    public func

    }

    public function testPhpDeprecation(): void
    {
        (new Source)->triggerPhpDeprecation();

        $this->assertTrue(true);
    }

    public function testPhpNoticeAndWarning(): void
    {
        (new Source)->triggerPhpNoticeAndWarning(

tion testNotice(): void
    {
        (new Source)->triggerNotice();

        $this->assertTrue(true);
    }

    public function testWarning(): void
    {
        (new Source)->triggerWarning();

        $this->assertTrue(true);


hpDeprecation();
    }

    public function triggerPhpNoticeAndWarning(): void
    {
        $this->phpNoticeAndWarning();
    }

    private function deprecation(): void
    {
        trigger_error('deprecation', E_USER_DEPRECATED);
    }

    private fun


?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Baseline;

use PHPUnit\Framework\TestCase;

final class SourceTest extends TestCase
{
    public function testDeprecation(): void
    {
        (new Source)->triggerDeprecation();

        $this->assertTrue(true);
    }

    publi

true);
    }

    public function testPhpDeprecation(): void
    {
        (new Source)->triggerPhpDeprecation();

        $this->assertTrue(true);
    }

    public function testPhpNoticeAndWarning(): void
    {
        (new Source)->triggerPhpNoticeAndWa

c function testNotice(): void
    {
        (new Source)->triggerNotice();

        $this->assertTrue(true);
    }

    public function testWarning(): void
    {
        (new Source)->triggerWarning();

        $this->assertTrue(


* This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Event;

use PHPUnit\Framework\Attributes\BackupGlobals;
use PHPUnit\Framework\Attributes\ExcludeGlobalVariableFromBackup;
use PHPUnit\Framework\TestCase;

#[BackupGlobals(true)]
#[ExcludeGlobalVariableFromBackup('excludedVar')]
final class BackupGlobalsWithExclude

One(): void
    {
        $GLOBALS['excludedVar'] = 'should not be backed up';

        $this->assertTrue(true);
    }

    public function testTwo(): void
    {
        $this->assertSame('should not be backed up', $GLOBALS['excludedVar'] ?? null);

ListTest extends TestCase
{
    public function test


e(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Event;

use Iterator;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class DataProviderInvalidKeyTest extends TestCase
{
    public static function provider(): Iterator
    {
        return new class im

             $this->position++;
            }

            public function key(): float
            {
                return 0.1;
            }

            public function valid(): bool
            {
                return $this->position === 0;

plements Iterator
        {
            private int $position;

            public function current(): string
            {
                return 'value';
            }

            public function next(): void
            {


e(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Event;

use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\Attributes\DependsUsingDeepClone;
use PHPUnit\Framework\Attributes\DependsUsingShallowClone;
use PHPUnit\Framework\TestCase;
use stdClass;

final class DependencyReturnV

ndsUsingDeepClone('testProducer')]
    public function testDeepCloneConsumer(stdClass $obj): void
    {
        $this->assertSame('original', $obj->value);
    }

    #[DependsUsingShallowClone('testProducer')]
    public function testShallowCloneConsumer(

alueCloningTest extends TestCase
{
    public function testProducer(): stdClass
    {
        $obj        = new stdClass;
        $obj->value = 'original';

        $this->assertTrue(true);

        return $obj;
    }

    #[Depe


* This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Event;

use const E_USER_DEPRECATED;
use function error_get_last;
use function trigger_error;
use PHPUnit\Framework\TestCase;

final class DeprecatedFeatureTest extends TestCase
{
    public function testDeprecatedFeature(): void
    {
        trigger_error('messa

sage', E_USER_DEPRECATED);

        $this->assertTrue(true);
    }

    public function testDeprecatedSuppressedErrorGetLast(): void
    {
        $this->assertNull(error_get_last());
        @trigger_error('message', E_USER_DEPRECATED);
        $this->ass

ge', E_USER_DEPRECATED);
        @trigger_error('mes


?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Metadata\Attribute;

use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\Attributes\TestDoxFormatter;
use PHPUnit\Framework\Attributes\TestDoxFormatterExternal;
use PHPUnit\Framework\TestCase;

#[TestDox('text')]
final

'text')]
    public function testOne(): void
    {
    }

    #[TestDoxFormatter('methodName')]
    public function testTwo(): void
    {
    }

    #[TestDoxFormatterExternal('ClassName', 'methodName')]
    public function testThree(): void
    {
    }
}

 class TestDoxTest extends TestCase
{
    #[TestDox(


hp declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture\Metadata\Attribute;

use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\Attributes\UsesClassesThatExtendClass;
use PHPUnit\Framework\Attributes\UsesClassesThatImplementInterface;
use PHPUnit\Framework\Attributes\UsesF

ibute')]
#[UsesClass(Example::class)]
#[UsesClassesThatExtendClass(Example::class)]
#[UsesClassesThatImplementInterface(Example::class)]
#[UsesTrait(ExampleTrait::class)]
#[UsesMethod(Example::class, 'method')]
#[UsesFunction('f')]
final class UsesTest ext

unction;
use PHPUnit\Framework\Attributes\UsesMethod;
use PHPUnit\Framework\Attributes\UsesNamespace;
use PHPUnit\Framework\Attributes\UsesTrait;
use PHPUnit\Framework\TestCase;

#[UsesNamespace('PHPUnit\TestFixture\Metadata\Attr


 is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class DataProviderSkipWhenFilteredTest extends TestCase
{
    public static function providerForA(): array
    {
        return [[1], [2]];
    }

    public static function providerForB(

 #[DataProvider('providerForA')]
    public function testA(int $i): void
    {
        $this->assertGreaterThan(0, $i);
    }

    #[DataProvider('providerForB')]
    public function testB(int $i): void
    {
        $this->assertGreaterThan(0, $i);
    }


 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\DataProviderExternal;
use PHPUnit\Framework\TestCase;

final class DataProviderTest extends TestCase
{
    public static function externalProvider(): iterable
    {
        yield 'f

tion provider(): iterable
    {
        yield 'foo2' => ['bar', 'baz'];
    }

    #[DataProvider('provider')]
    #[DataProviderExternal(self::class, 'externalProvider')]
    public function testWithDifferentProviderTypes($one, $two): void
    {
        $

oo' => ['bar', 'baz'];
    }

    public static func


hp declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\After;
use PHPUnit\Framework\Attributes\Before;

final class HookMethodsOrderTest extends HookMethodsOrderTestCase
{
    protected function setUp(): void
    {
    }

    protected function tearDow

oid
    {
    }

    #[Before(priority: 1)]
    protected function beforeWithPriority(): void
    {
    }

    #[After]
    protected function afterFirst(): void
    {
    }

    #[After]
    protected function afterSecond(): void
    {
    }

    #[After(

n(): void
    {
    }

    public function testOne(): void
    {
        $this->assertTrue(true);
    }

    #[Before]
    protected function beforeSecond(): void
    {
    }

    #[Before]
    protected function beforeFirst(): v


tian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use const E_USER_DEPRECATED;
use const E_USER_NOTICE;
use const E_USER_WARNING;
use function trigger_error;
use Exception;
use PHPUnit\Framework\TestCase;

final class OutcomesAndIssuesTest extends TestCase
{
    public function testSuccessWithoutIssues(): void
    {
        $this->assertTrue(true);
    }

    public function t

estSuccessWithNotice(): void
    {
        trigger_error('notice message', E_USER_NOTICE);

        $this->assertTrue(true);
    }

    public function testSuccessWithWarning(): void
    {
        trigger_error('warning message', E_USER_WARNING);

estSuccessWithRisky(): void
    {
    }

    public function testSuccessWithDeprecation(): void
    {
        trigger_error('deprecation message', E_USER_DEPRECATED);

        $this->assertTrue(true);
    }

    public function t


 declare(strict_types=1);

/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use PHPUnit\Framework\TestCase;

final class TestProcessIsolationWithDataProvider extends TestCase
{
    public static function g

er(): iterable
    {
        yield ['Hello world!'];
    }

    #[RunInSeparateProcess]
    #[DataProvider('greetDataProvider')]
    public function testInIsolationWithProvider(string $expected): void
    {
        $this->assertSame($expected, 'Hello world


<?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use ArrayAccess;

final class SampleArrayAccess implements ArrayAccess
{
    private array $container;

    public function __construct()
    {
        $this->container = [];
    }

    public function offsetSet($offset, $value

  return isset($this->container[$offset]);
    }

    public function offsetUnset($offset): void
    {
        unset($this->container[$offset]);
    }

    public function offsetGet($offset): mixed
    {
        return $this->container[$offset] ?? null;

): void
    {
        if (null === $offset) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    public function offsetExists($offset): bool
    {


php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\Ticket;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framew

[UsesClass(CoveredClass::class)]
#[Group('the-group')]
#[Ticket('the-ticket')]
#[Small]
final class SmallGroupAnnotationsTest extends TestCase
{
    #[Group('another-group')]
    #[Ticket('another-ticket')]
    public function testOne(): void
    {
    }
}

ork\TestCase;

#[CoversClass(CoveredClass::class)]
#


e(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\TestCase;
use Throwable;

final class TemplateMethodsTest extends TestCase
{
    public static function setUpBeforeClass(): void
    {
        print __METHOD__ . "\n";
    }

    public static function tearDownAfterCl

;
    }

    protected function assertPostConditions(): void
    {
        print __METHOD__ . "\n";
    }

    protected function tearDown(): void
    {
        print __METHOD__ . "\n";
    }

    public function testOne(): void
    {
        print __METHO

ass(): void
    {
        print __METHOD__ . "\n";
    }

    protected function setUp(): void
    {
        print __METHOD__ . "\n";
    }

    protected function assertPreConditions(): void
    {
        print __METHOD__ . "\n"


n <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use Iterator;

final class TestIterator implements Iterator
{
    private array $array;
    private int $position = 0;

    public function __construct(array $array = [])
    {
        $this->array = $array;
    }

    public function rewind(): void
    {
        $this->position = 0;
    }

    public function valid():

position]);
    }

    public function key(): int|string
    {
        return $this->position;
    }

    public function current(): mixed
    {
        return $this->array[$this->position];
    }

    public function next(): void
    {
        $this->posi

bool
    {
        return isset($this->array[$this->


declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\Attributes\After;
use PHPUnit\Framework\Attributes\AfterClass;
use PHPUnit\Framework\Attributes\Before;
use PHPUnit\Framework\Attributes\BeforeClass;
use PHPUnit\Framework\Attributes\PostCondition;
use PHPUnit\F

    #[AfterClass(priority: 6)]
    public static function afterLastTest(): void
    {
    }

    #[Before(priority: 2)]
    protected function beforeEachTest(): void
    {
    }

    #[PreCondition(priority: 3)]
    protected function preConditions(): void

ramework\Attributes\PreCondition;
use PHPUnit\Framework\TestCase;

final class TestWithHookMethodsPrioritizedTest extends TestCase
{
    #[BeforeClass(priority: 1)]
    public static function beforeFirstTest(): void
    {
    }


art of PHPUnit.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use Generator;
use PHPUnit\Framework\Attributes\DataProvider;

final class VariousIterableDataProviderTest extends AbstractVariousIterableDataProviderTest
{
    public static function asArrayStaticProvider(): array
    {
        return [
            ['A'],
            ['B'],

der(): WrapperIteratorAggregate
    {
        return new WrapperIteratorAggregate([
            ['G'],
            ['H'],
            ['I'],
        ]);
    }

    public static function asArrayProvider(): array
    {
        return [
            ['S'],

          ['C'],
        ];
    }

    public static function asIteratorStaticProvider(): Generator
    {
        yield ['D'];

        yield ['E'];

        yield ['F'];
    }

    public static function asTraversableStaticProvi