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\DependsUsingShallowClone;
use PHPUnit\Framework\TestCase;

class DependencyFailureTest extends TestCase
{
    public function testOne(): void
    {
        $t

tTrue(true);
    }

    #[DependsUsingShallowClone('testOne')]
    public function testFour(): void
    {
        $this->assertTrue(true);
    }

    #[Depends('doesNotExist')]
    public function testHandlesDependencyOnTestMethodThatDoesNotExist(): void

his->assertTrue(false);
    }

    #[Depends('testOne')]
    public function testTwo(): void
    {
        $this->assertTrue(true);
    }

    #[Depends('testTwo')]
    public function testThree(): void
    {
        $this->asser


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\After;
use PHPUnit\Framework\Attributes\AfterClass;
use PHPUnit\Framework\Attributes\Before;
use PHPUnit\Framework\Attributes\BeforeClass;
use PHPUnit\Framework\Attributes\PostCondi

ass]
    public function beforeTests(): void
    {
    }

    #[Before]
    public function beforeTest(): void
    {
    }

    #[PreCondition]
    public function preCondition(): void
    {
    }

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

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

#[Small]
final class SmallTest extends TestCase
{
    #[BeforeCl


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\DeprecatedAnnotationsTestFixture;

use PHPUnit\Framework\Attributes\Before;
use PHPUnit\Framework\TestCase;

final class BeforeTestMethodWithPrioritizedAttributeTest extends TestCase
{
    protected function setUp(): void
    {
    }

    publ

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

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

    #[Before(priority: -1)]
    protected function beforeMethodWithLowPriority(): void
    {


 that was distributed with this source code.
 */
namespace PHPUnit\TestFixture;

use Exception;
use PHPUnit\Framework\TestCase;

final class ExpectingExceptionsTest extends TestCase
{
    public function test_expectException_and_expected_exception_is_thrown(): void
    {
        $this->expectException(Exception::class);

        throw new Exception;
    }

    public function test_expectException_and_expected_exception_is_not_thrown(): void
    {
        $this->expectException(Exception::class);
    }

ntains('message');

        throw new Exception('message');
    }

    public function test_expectExceptionMessage_and_exception_is_thrown_and_has_expected_message(): void
    {
        $this->expectExceptionMessageIsOrContains('message');

        throw n

public function test_expectException_and_expectExceptionMessage_and_expected_exception_is_thrown_and_has_expected_message(): void
    {
        $this->expectException(Exception::class);
        $this->expectExceptionMessageIsOrCo


 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;
use PHPUnit\Framework\TestCase;

abstract class HookMethodsOrderTestCase extends TestCase
{
    #[Before]
    protected function beforeInParent(): void

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

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

    #[After(priority: 1)]
    protected function afterWithPriorityInParent(): 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;

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 SmallGroupAttributesTest 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 DateTimeImmutable;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\Attributes\TestDoxFormatter;
use PHPUnit\Framework\TestCase;

final class TestDoxTest extends TestCase
{
    public static function formatter(DateTimeIm

s a custom test description')]
    public function testThree(): void
    {
    }

    #[TestDox('This is a custom test description with placeholders $a $b $f $i $s $o $stdClass $enum $backedEnum $n $empty $default')]
    public function testFour(array $a,

mutable $date): string
    {
        return 'This is a custom description: ' . $date->format('Y-m-d');
    }

    public function testOne(): void
    {
    }

    public function testTwo(): void
    {
    }

    #[TestDox('This i


 * (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 current;
use function key;
use function next;
use function reset;
use Iterator;

final class TestIterator2 implements Iterator
{
    private array $data;

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

    public function current(): mixed

ublic function next(): void
    {
        next($this->data);
    }

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

    public function valid(): bool
    {
        return key($this->data) !== null;
    }

    public

 {
        return current($this->data);
    }

    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\MockObject;

class ExtendableClass
{
    public bool $constructorCalled = false;

    public function __construct()
    {
        $this->constructorCalled = true;
    }

    public function __destruct()
    {
    }

    public function

: bool
    {
        return $this->doSomethingElse();
    }

    public function doSomethingElse(): bool
    {
        return false;
    }

    final public function finalMethod(): void
    {
    }

    private function privateMethod(): 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\Metadata\Attribute;

use PHPUnit\Framework\Attributes\TestWith;
use PHPUnit\Framework\Attributes\TestWithJson;
use PHPUnit\Framework\TestCase;

final class TestWithTest extends TestCase
{
    #[TestWith([1, 2, 3])]
    public func

true);
    }

    #[TestWithJson('[1, 2, 3]')]
    public function testTwo($one, $two, $three): void
    {
        $this->assertTrue(true);
    }

    #[TestWithJson('[1, 2, 3]', 'Name2')]
    public function testTwoWithName($one, $two, $three): void
    {

tion testOne($one, $two, $three): void
    {
        $this->assertTrue(true);
    }

    #[TestWith([1, 2, 3], 'Name1')]
    public function testOneWithName($one, $two = null, $three = null): 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\DataProviderExternal;
use PHPUnit\Framework\Attributes\TestWith;
use PHPUnit\Framework\TestCase;

final class TestWithAttributeAndExternalDataProviderTest extends TestCase
{
    public static functi

 iterable
    {
        yield 'foo' => ['bar', 'baz'];
    }

    #[TestWith(['a', 'b'], 'foo')]
    #[DataProviderExternal(self::class, 'provider')]
    public function testWithDifferentProviderTypes($one, $two): void
    {
        $this->assertTrue(true)


* 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\CoversNothing;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\TestCase;

#[Small]
#[CoversNothing]
final class SmallTestWithDataProvider extends TestCase
{
    public

eturn [
            [true],
            [false],
        ];
    }

    #[DataProvider('provideData')]
    public function testWithProvider(bool $value): void
    {
        $this->assertTrue(true);
    }

    public function testWithoutProvider(): void

static function provideData(): array
    {
        r


* 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 FooBarHandler;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\TestCase;

final class RouterTest extends TestCase
{
    public static function routesProvider(): array
    {
        return [

               FooBarHandler::class,
                // ...
            ],
        ];
    }

    #[DataProvider('routesProvider')]
    #[TestDox('Routes $url to $handler')]
    public function testRoutesRequest(string $url, string $handler): void
    {

       '/foo/bar' => [
                '/foo/bar',


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

Class]
    public static function afterLastTestWithAttribute(): void
    {
    }

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

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

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

final class TestWithHookMethodsTest extends TestCase
{
    #[BeforeClass]
    public static function beforeFirstTestWithAttribute(): void
    {
    }

    #[After


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 const E_USER_DEPRECATED;
use function trigger_error;
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
use PHPUnit\Framework\TestCase;

#[IgnoreDeprecations('foo')]
final class IgnoreDeprecationsWithPatternTest extends TestCas

function testTwo(): void
    {
        trigger_error('foo', E_USER_DEPRECATED);

        $this->assertTrue(true);
    }

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

e
{
    #[IgnoreDeprecations('bar')]
    public function testOne(): void
    {
        trigger_error('foo', E_USER_DEPRECATED);
        trigger_error('bar', E_USER_DEPRECATED);

        $this->assertTrue(true);
    }

    public


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 file_exists;
use function file_get_contents;
use function getmypid;
use function unlink;
use PHPUnit\Framework\TestCase;

final class SeparateClassRunMethodInNewProcessTest extends TestCase
{
    public const string PROCESS_ID_FILE_PATH

public static $processId                   = self::INITIAL_PROCESS_ID;

    public static function setUpBeforeClass(): void
    {
        if (file_exists(self::PROCESS_ID_FILE_PATH)) {
            self::$parentProcessId = (int) file_get_contents(self::PROC

 = __DIR__ . '/parent_process_id.txt';
    public const int INITIAL_PARENT_PROCESS_ID = 0;
    public const int INITIAL_PROCESS_ID        = 1;
    public static $parentProcessId             = self::INITIAL_PARENT_PROCESS_ID;


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 IssueTest6105;

use function header;
use function ob_get_clean;
use function ob_start;
use function xdebug_get_headers;
use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\Attribu

[RequiresPhpExtension('xdebug')]
    public function test_case_2_check(): void
    {
        ob_start();
        header('X-Test: Testing');
        print 'asd';
        $content = ob_get_clean();

        $this->assertSame('asd', $content);
        $this->

tes\RunInSeparateProcess;
use PHPUnit\Framework\TestCase;

#[CoversNothing]
class IssueTest6105 extends TestCase
{
    public function test_1(): void
    {
        $this->assertTrue(true);
    }

    #[RunInSeparateProcess]
    #


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\Issue6511;

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

final class Issue6511Test extends TestCase
{
    public static function provideOneCases(): iterable
    {
        yield [
            'c' => 'Charlie',
            'a' => 'Alfa',

he a is $a, the b is $b, the c is $c.')]
    #[DataProvider('provideOneCases')]
    public function testOne($a, $b, $c): void
    {
        $this->assertSame('Alfa', $a);
        $this->assertSame('Bravo', $b);
        $this->assertSame('Charlie', $c);

  'b' => 'Bravo',
        ];
    }

    #[TestDox('T


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\Issue5949;

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

class Issue5949Test extends TestCase
{
    #[TestDox("Test 1. No dollar sign.\n")]
    public function test1(): void
    {
        $this->assertTrue(true)

his->assertTrue(true);
    }

    #[TestDox("Test 4. No dollar sign.\n")]
    public function test4(): void
    {
        $this->assertTrue(true);
    }

    #[TestDox("Test 5. Dollar \$ sign.\n           More text.\n")]
    public function test5(): void

;
    }

    #[TestDox("Test 2. No dollar sign.\n")]
    public function test2(): void
    {
        $this->assertTrue(true);
    }

    #[TestDox("Test 3. Dollar sign (\$).\n")]
    public function test3(): void
    {
        $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 Exception;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

class Issue498Test extends TestCase
{
    public static fun

te the data");
    }

    #[Test]
    #[DataProvider('shouldBeTrueDataProvider')]
    #[Group('falseOnly')]
    public function shouldBeTrue($testData): void
    {
        $this->assertTrue(true);
    }

    #[Test]
    #[DataProvider('shouldBeFalseDataPro

ction shouldBeTrueDataProvider(): array
    {
        return [
            [true],
            [false],
        ];
    }

    public static function shouldBeFalseDataProvider(): array
    {
        throw new Exception("Can't crea


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\Issue2725;

use function getmypid;
use PHPUnit\Framework\Attributes\AfterClass;
use PHPUnit\Framework\Attributes\BeforeClass;
use PHPUnit\Framework\TestCase;

class BeforeAfterClassPidTest extends TestCase
{
    public const PID_VARIAB

      if ($GLOBALS[static::PID_VARIABLE] - getmypid() !== 0) {
            print "\n@afterClass output - PID difference should be zero!";
        }

        unset($GLOBALS[static::PID_VARIABLE]);
    }

    public function testMethod1WithItsBeforeAndAfter(

LE = 'current_pid';

    #[BeforeClass]
    public static function showPidBefore(): void
    {
        $GLOBALS[static::PID_VARIABLE] = getmypid();
    }

    #[AfterClass]
    public static function showPidAfter(): 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\Issue6599;

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

final class Issue6599Test extends TestCase
{
    public static function provider(): array
    {
        return [
            'one' => [1],
            'two' => [2],
        ];
    }

    protected function set

'failure in setUp');
    }

    #[DataProvider('provider')]
    public function testWithDataProvider(int $value): void
    {
        $this->assertGreaterThan(0, $value);
    }

    public function testWithoutDataProvider(): void
    {
        $this->assert

Up(): void
    {
        throw new RuntimeException(


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\Issue5822;

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

final class Issue5822Test extends TestCase
{
    public function testDebugBacktrace(): void
    {

ertTrue(true);
    }

    private function callUserFuncExample(): void
    {
        call_user_func($this->exampleCallback(...));
    }

    private function exampleCallback(): void
    {
        trigger_error('My Deprecation Error', E_USER_DEPRECATED);

    $this->callUserFuncExample();
        $this->ass


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 const PHP_OUTPUT_HANDLER_FLUSHABLE;
use function ob_clean;
use function ob_end_clean;
use function ob_flush;
use function ob_start;
use PHPUnit\Framework\TestCase;

final class Issue5851Test extends TestCase
{
    public function

      $this->expectOutputString('hello');

        print 'hello';
        ob_flush();
    }

    public function testBufferSubstitutionDetected(): void
    {
        ob_end_clean();
        ob_start();

        $this->assertTrue(true);
    }

    public fu

 testOutputCapturedAfterObClean(): void
    {
        $this->expectOutputString('hello');

        print 'hel';
        ob_clean();
        print 'hello';
    }

    public function testOutputCapturedAfterObFlush(): 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;

use function defined;
use PHPUnit\Framework\Attributes\PreserveGlobalState;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use PHPUnit\Framework\TestCase;

#[PreserveGlobalState(true)]
class Issue2158Test extends TestCa

ly in main process constant should be available and
     * no errors should be yielded by reload of included files.
     */
    #[RunInSeparateProcess]
    public function testSomethingElse(): void
    {
        $this->assertTrue(defined('TEST_CONSTANT'));

se
{
    /**
     * Set constant in main process.
     */
    public function testSomething(): void
    {
        include __DIR__ . '/constant.inc';
        $this->assertTrue(true);
    }

    /**
     * Constant defined previous


 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\Issue4391;

use Exception;
use PHPUnit\Framework\Attributes\RequiresPhpunit;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
use PHPUnit\Framework\TestCase;

#[RunTestsInSeparateProcesses]
final class RunTestsInSeparateP

Test extends TestCase
{
    #[RequiresPhpunit('< 10.0.0')]
    public function testOne(): void
    {
        throw new Exception('message');
    }

    #[RequiresPhpunit('< 10.0.0')]
    public function testTwo(): void
    {
        throw new Exception('me


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.
 */
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\TestCase;

final class Issue5178Test extends TestCase
{
    public static function fooDataProvider(): array
    {
        return [
            'foo 1' =

   ];
    }

    #[DataProvider('fooDataProvider')]
    public function testFoo(string $input): void
    {
        $this->assertNotEmpty($input);
    }

    #[Depends('testFoo')]
    public function testBar(): void
    {
        $this->assertTrue(true);


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\Issue6451;

use PHPUnit\Framework\Attributes\RequiresPhp;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\Attributes\RequiresPhpunit;
use PHPUnit\Framework\TestCase;

final class Issue6451Test extends TestC

      $this->assertTrue(true);
    }

    #[RequiresPhpExtension('json', '>= 1')]
    public function testIncompletePhpExtensionVersion(): void
    {
        $this->assertTrue(true);
    }

    #[RequiresPhp('>= 8.0.0')]
    #[RequiresPhpunit('>= 10.0.0')]

ase
{
    #[RequiresPhp('>= 8')]
    public function testIncompletePhpVersion(): void
    {
        $this->assertTrue(true);
    }

    #[RequiresPhpunit('>= 10')]
    public function testIncompletePhpunitVersion(): 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\Issue5891;

use IteratorAggregate;
use PDOException;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use ReflectionClass;
use Traversable;

#[RequiresPhpExtension('pdo')]
final class Issue5965Test exten

e($exception, 'HY000');

        $this->assertIsString($exception->getCode());

        $iterator = new class($exception) implements IteratorAggregate
        {
            public PDOException $exception;

            public function __construct($exception

ds TestCase
{
    public function testOne(): void
    {
        $exception = new PDOException;
        $reflector = new ReflectionClass($exception);

        $property = $reflector->getProperty('code');
        $property->setValu


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\Issue5891;

use PHPUnit\Framework\TestCase;

final class Issue5891Test extends TestCase
{
    public function testVariadicParam(): void
    {
        $mock = $this->createMock(ArgumentList::class);

        $mock
            ->expects($this-

$mock->foo(1, 2, 3);
    }

    public function testTwoParametersAndVariadicParam(): void
    {
        $mock = $this->createMock(TwoParametersAndArgumentList::class);

        $mock
            ->expects($this->once())
            ->method('foo')

>once())
            ->method('foo')
            ->with($this->callback(static function (...$items): bool
            {
                self::assertSame([1, 2, 3], $items);

                return true;
            }));


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\Issue6408;

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

final class Issue6408Test extends TestCase
{
    public static function provideData(): iterable
    {
        yield from

sertTypes();
    }

    public static function gatherAssertTypes(): array
    {
        throw new RuntimeException('a users exception from data-provider context');
    }

    #[DataProvider('provideData')]
    public function testFoo(): void
    {
    }
}


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\TestFixture\ExecutionOrder\Defects;

use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\TestCase;
use RuntimeException;

#[CoversNothing]
final class BarTest extends TestCase
{
    public function testOne(): void
    {
        $this

rue);
    }

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

    public function testThree(): void
    {
        throw new RuntimeException('message');
    }

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


 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\Issue6595;

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

final class FailureInSetUpBeforeClassWithDataProviderTest extends TestCase
{
    public static function provider(): array
    {
        return

}

    public static function setUpBeforeClass(): void
    {
        self::fail('failure in setUpBeforeClass');
    }

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


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\Issue6279;

use const E_USER_DEPRECATED;
use const E_USER_WARNING;
use function trigger_error;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\DataProviderExternal;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Frame

    public static function dataWith2Deprecations(): iterable
    {
        @trigger_error('first', E_USER_DEPRECATED);
        @trigger_error('second', E_USER_DEPRECATED);
        @trigger_error('warning', E_USER_WARNING);

        yield [true];
    }

work\TestCase;

class TriggersDeprecationInDataProvider1Test extends TestCase
{
    public static function dataProvider(): iterable
    {
        @trigger_error('some deprecation', E_USER_DEPRECATED);

        yield [true];
    }


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\Issue6279;

use const E_USER_DEPRECATED;
use function trigger_error;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

class Trigge

 public static function dataProvider2(): iterable
    {
        @trigger_error('some deprecation 2', E_USER_DEPRECATED);

        yield [true];
    }

    public static function dataProvider3(): iterable
    {
        @trigger_error('some deprecation 3', E

rsDeprecationInDataProviderUsingIgnoreDeprecationsTest extends TestCase
{
    public static function dataProvider1(): iterable
    {
        @trigger_error('some deprecation', E_USER_DEPRECATED);

        yield [true];
    }


 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 PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\TestCase;

class Issue765Test extends TestCase
{
    public static function dependentProvider(): void

w new Exception;
    }

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

    #[Depends('testDependee')]
    #[DataProvider('dependentProvider')]
    public function testDependent($a): void
    {
        $this->assertTr


* 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\DeprecationCollector;

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

final class DeprecationCollectorResetTest extends TestCase
{
    #[IgnoreDeprecations]
    public

        $this->expectUserDeprecationMessage('first deprecation');

        trigger_error('first deprecation', E_USER_DEPRECATED);
    }

    #[IgnoreDeprecations]
    public function testSecondDoesNotSeeFirstDeprecation(): void
    {
        $this->expectU

function testFirstTriggersDeprecation(): 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 const E_USER_DEPRECATED;
use function error_get_last;
use function trigger_error;
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
use PHPUnit\Framework\TestCase;

final class IgnoreDeprecationsTest extends TestCase
{
    #[I

 E_USER_DEPRECATED);

        $this->assertTrue(true);
    }

    #[IgnoreDeprecations]
    public function testOneErrorGetLast(): void
    {
        $this->assertNull(error_get_last());
        trigger_error('message', E_USER_DEPRECATED);
        $this->a

gnoreDeprecations]
    public function testOne(): void
    {
        trigger_error('message', E_USER_DEPRECATED);

        $this->assertTrue(true);
    }

    public function testTwo(): void
    {
        trigger_error('message',


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\ErrorHandlerCanBeDisabled;

use const E_USER_WARNING;
use function error_get_last;
use function fopen;
use function trigger_error;
use Exception;

final class Foo
{
    public function methodA($fileName)
    {
        $stream_handle = @fopen($fileName, 'wb');

        i

error_get_last();

            throw new Exception($error['message']);
        }

        return $stream_handle;
    }

    public function methodB(): ?array
    {
        @trigger_error('Triggering', E_USER_WARNING);

        return error_get_last();

f ($stream_handle === false) {
            $error =


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\Event\SkipInBeforeClass;

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

final class SkippedBeforeClassTest extends TestCase
{
    public static function provideData(): iterable
    {
        f

[true];
        }
    }

    public static function setUpBeforeClass(): void
    {
        self::markTestSkipped('Skipped in before class');
    }

    #[DataProvider('provideData')]
    public function test1(bool $bool): void
    {
        $this->assertTr

oreach (range(1, 100) as $item) {
            yield


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\ErrorHandler\UserDeprecation;

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

final class UserDeprecationTest extends TestCase
{
    public function testFromTestCode(): void
    {
        @tri

    public function testDirect(): void
    {
        (new FirstPartyClass)->callThirdParty();

        $this->assertTrue(true);
    }

    public function testThirdPartyCallsFirstParty(): void
    {
        (new ThirdPartyClass)->callFirstParty();

gger_error('deprecation in test code', E_USER_DEPRECATED);

        $this->assertTrue(true);
    }

    public function testSelf(): void
    {
        (new FirstPartyClass)->triggerSelf();

        $this->assertTrue(true);
    }


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\TestFixture\ExecutionOrder\Defects;

use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\TestCase;
use RuntimeException;

#[CoversNothing]
final class FooTest extends TestCase
{
    public function testOne(): void
    {
        $this


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\TestFixture\ExecutionOrder\Defects;

use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\TestCase;
use RuntimeException;

#[CoversNothing]
final class BazTest extends TestCase
{
    public function testOne(): void
    {
        $this


nn <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\Issue6279;

use const E_USER_DEPRECATED;
use function trigger_error;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

class TriggersDeprecationInDataProvider2Test extends TestCase
{
    public static

igger_error('some deprecation 1', E_USER_DEPRECATED);

        yield [true];
    }

    #[Test]
    #[DataProvider('dataProvider')]
    #[IgnoreDeprecations]
    public function methodWithSameNameThanInAnotherTest(bool $value): void
    {
        $this->as

 function dataProvider(): iterable
    {
        @tr


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\DoesNotPerformAssertions;
use PHPUnit\Framework\TestCase;

final class ExpectedAndUnexpectedAssertionsTest extends TestCase
{
    #[DoesNotPerformAssertions]
    public function testOne(): void
    {
    }

    public function testTwo(

tions();
    }

    #[DoesNotPerformAssertions]
    public function testThree(): void
    {
        $this->assertTrue(true);
    }

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

        $this->assertTrue(true);


 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\Event;

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

final class InvalidParameterNameDataProviderTest extends TestCase
{
    public static function values(): array
    {
        return [

rue, 'value2' => true],
            ['value3' => true, 'value4' => true],
        ];
    }

    #[DataProvider('values')]
    public function testSuccess(bool $value1, bool $value2): void
    {
        $this->assertTrue($value1);
        $this->assertTrue(


clare(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 const E_USER_WARNING;
use function error_get_last;
use function trigger_error;
use PHPUnit\Framework\TestCase;

final class SuppressedUserWarningTest extends TestCase
{
    public function testSuppressedUserWarning(): void

er_error('message', E_USER_WARNING);
    }

    public function testSuppressedUserWarningErrorGetLast(): void
    {
        $this->assertNull(error_get_last());
        @trigger_error('message', E_USER_WARNING);
        $this->assertIsArray(error_get_last(

  {
        $this->assertTrue(true);

        @trigg


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\Event;

use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\TestCase;
use RuntimeException;
use Throwable;

final class TransformExceptionToAssertionFailedErrorDuringPreparationTest extends TestCase
{
    protected func

ception('setup failed');
    }

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

    protected function transformException(Throwable $t): Throwable
    {
        return new AssertionFailedError($t->getMessage(), 0, $t);

tion setUp(): void
    {
        throw new RuntimeEx


 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\Event;

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

final class UserNoticeTest extends TestCase
{
    public function testUserNotice(): void
    {
        $this->a

);

        trigger_error('message', E_USER_NOTICE);
    }

    public function testUserNoticeErrorGetLast(): void
    {
        $this->assertNull(error_get_last());
        trigger_error('message', E_USER_NOTICE);
        $this->assertIsArray(error_get_la


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\Event\ErrorHandlerCanBeDisabled;

use function restore_error_handler;
use function set_error_handler;
use function sys_get_temp_dir;
use function tempnam;
use Exception;
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
use PHPUnit\Framework\TestCase

eption::class);
        $this->expectExceptionMessageIsOrContains('Failed to open stream');

        (new Foo)->methodA($fileName);
    }

    #[WithoutErrorHandler]
    public function testMethodB(): void
    {
        $this->assertSame('Triggering', (new

;

final class FooTest extends TestCase
{
    #[WithoutErrorHandler]
    public function testMethodA(): void
    {
        $fileName = tempnam(sys_get_temp_dir(), 'RLT') . '/missing/directory';

        $this->expectException(Exc


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\ErrorHandler;

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

final class UserDeprecationViaArrayMapTest extends TestCase
{
    public function testUserDeprecationTriggeredIn

llback(): void
    {
        array_map(static function (int $value): int
        {
            @trigger_error('deprecation from array_map callback', E_USER_DEPRECATED);

            return $value;
        }, [1]);

        $this->assertTrue(true);
    }
}


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\Issue6222;

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

class Issue6222Test extends TestCase
{
    public static function provider(): iterable
    {
        yield

GreaterThan(0, $x);
    }

    #[Depends('testTwoCasesPassing')]
    public function testDependingOnTwoCasesPassing(): void
    {
        $this->assertTrue(true);
    }

    #[DataProvider('provider')]
    public function testOneCasePassing(int $x): void

 [1];

        yield [2];
    }

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

    #[DataProvider('provider')]
    public function testTwoCasesPassing(int $x): void
    {
        $this->assert


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 restore_error_handler;
use function restore_exception_handler;
use function set_error_handler;
use function set_exception_handler;
use PHPUnit\Framework\TestCase;
use Throwable;

class Issue5845Test extends TestCase
{
    public function t

       set_error_handler($this->errorHandler(...));

        $this->assertTrue(false);
    }

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

    public function testAddedA

estAddedAndRemovedErrorHandler(): void
    {
        set_error_handler($this->errorHandler(...));
        restore_error_handler();

        $this->assertTrue(true);
    }

    public function testAddedErrorHandler(): 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\Event;

use PHPUnit\Event\Facade as EventFacade;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\IgnorePhpunitWarnings;
use PHPUnit\Framework\TestCase;

final class PhpunitWarningIgnoredTest extends TestCase
{
    public static function dataProvide

ts(),
            'warning message',
        );

        $this->assertTrue(true);
    }

    #[IgnorePhpunitWarnings('warning message')]
    public function testPhpunitWarningWithExactMessage(): void
    {
        EventFacade::emitter()->testTriggeredPhpun

r(): iterable
    {
        yield [true];
    }

    #[IgnorePhpunitWarnings]
    public function testPhpunitWarning(): void
    {
        EventFacade::emitter()->testTriggeredPhpunitWarning(
            $this->valueObjectForEven


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\Event;

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

final class UserWarningTest extends TestCase
{
    public function testUserWarning(): void
    {
        $this->assertTrue(true);

ger_error('message', E_USER_WARNING);
    }

    public function testUserWarningErrorGetLast(): void
    {
        $this->assertNull(error_get_last());
        trigger_error('message', E_USER_WARNING);
        $this->assertIsArray(error_get_last());
    }


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\ExecutionOrder\XmlDependsDefectsDurationAscending;

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

#[CoversNothing]
final class FooTest extends TestCase
{

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

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

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


 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\Event;

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

final class IgnoreDeprecationsWithMultiplePatternsTest extends TestCase
{
    #[Ign

s('foo')]
    #[IgnoreDeprecations('bar')]
    public function testOne(): void
    {
        trigger_error('foo', E_USER_DEPRECATED);
        trigger_error('bar', E_USER_DEPRECATED);
        trigger_error('baz', E_USER_DEPRECATED);

        $this->assertTr


* 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\TestCase;

final class TemplateMethodsTest extends TestCase
{
    public static function setUpBeforeClass(): void
    {
    }

    public static function tearDownAfterClass(): void
    {
    }

    protected function setUp(): void

(): void
    {
    }

    protected function assertPostConditions(): void
    {
    }

    protected function tearDown(): void
    {
    }

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

    public function testTwo(): voi

 {
    }

    protected function assertPreConditions


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\Event;

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

final class SuppressedUserNoticeTest extends TestCase
{
    public function testSuppressedUserNotice(): void
    {

or('message', E_USER_NOTICE);
    }

    public function testSuppressedUserNoticeErrorGetLast(): void
    {
        $this->assertNull(error_get_last());
        @trigger_error('message', E_USER_NOTICE);
        $this->assertIsArray(error_get_last());
    }

      $this->assertTrue(true);

        @trigger_err


 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\ExecutionOrder\SkippedAndFailing;

use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\TestCase;

#[CoversNothing]
final class FooTest extends TestCase
{
    public function testOne(): void
    {
        $this->asser

   }

    public function testTwo(): void
    {
        $this->markTestSkipped('message');
    }

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

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


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\Issue6115;

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

enum Enumeration: int
{
    case A = 1;
}

final class Issue6115Test extends TestCase
{
    publi

turn [
            [
                Enumeration::A,
            ],
        ];
    }

    #[DataProvider('provider')]
    #[TestDox('$enumeration')]
    public function testOne(Enumeration $enumeration): void
    {
        $this->assertTrue(true);
    }
}

c static function provider(): array
    {
        re


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\TestDox;

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

#[TestDox('Text from class-level TestDox metadata')]
final class DataProviderWithStringDataSetNameAndMetadata

              true,
            ],
        ];
    }

    #[DataProvider('provider')]
    #[TestDox('Text from method-level TestDox metadata for successful test')]
    public function testSomethingThatWorks(string $a, int $b, float $c, array $d, bool $e): v

Test extends TestCase
{
    public static function provider(): array
    {
        return [
            'data set name' => [
                'string',
                0,
                0.0,
                ['key' => '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\TestDox;

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

#[TestDox('Text from class-level TestDox metadata')]
final class DataProviderWithStringDataSetNameAndMetadataWithPlacehold

                true,
                Foo::BAR,
                Bar::FOO,
            ],
        ];
    }

    #[DataProvider('provider')]
    #[TestDox('Text from method-level TestDox metadata for successful test with placeholders ($a, $b, $c, $d, $e, $f

ersTest extends TestCase
{
    public static function provider(): array
    {
        return [
            'data set name' => [
                'string',
                0,
                0.0,
                ['key' => 'value'],


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\TestDox;

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

final class DataProviderWithStringDataSetNameTest extends TestCase
{
    public static function provider(): array
    {
        return [

tion testSomethingThatWorks(string $a, int $b, float $c, array $d, bool $e): void
    {
        $this->assertTrue(true);
    }

    #[DataProvider('provider')]
    public function testSomethingThatDoesNotWork(string $a, int $b, float $c, array $d, bool $e)

    'data set name' => [
                'string',
                0,
                0.0,
                ['key' => 'value'],
                true,
            ],
        ];
    }

    #[DataProvider('provider')]
    public func


clare(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\TestDox;

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

final class FormatterMethodDoesNotExistTest extends TestCase
{
    /**
     * @return non-empty-

static function provider(): array
    {
        return [
            ['string'],
        ];
    }

    #[DataProvider('provider')]
    #[TestDoxFormatter('formatter')]
    public function testOne(string $value): void
    {
        $this->assertTrue(true);

list<array{0: non-empty-string}>
     */
    public


 * (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\TestDox;

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

final class FormatterMethodIsNotPublicTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: non-empty-string}>
     */
    public static func

      ['string'],
        ];
    }

    #[DataProvider('provider')]
    #[TestDoxFormatter('formatter')]
    public function testOne(string $value): void
    {
        $this->assertTrue(true);
    }

    private static function formatter(string $value): st

tion provider(): array
    {
        return [


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\TestDox;

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

final class FormatterMethodIsNotStaticTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: non-empty-string}>
     */
    public static function provider(): array

  ];
    }

    public function formatter(string $value): string
    {
        return 'formatted ' . $value;
    }

    #[DataProvider('provider')]
    #[TestDoxFormatter('formatter')]
    public function testOne(string $value): void
    {
        $this->a

   {
        return [
            ['string'],


 * (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\TestDox;

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

final class FormatterMethodThrowsExceptionTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: non-empty-string}>
     */

    return [
            ['string'],
        ];
    }

    public static function formatter(string $value): string
    {
        throw new Exception('message');
    }

    #[DataProvider('provider')]
    #[TestDoxFormatter('formatter')]
    public function

 public static function provider(): array
    {


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\TestDox;

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

final class FormatterTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: non-empty-string}>
     */
    public static function provider(): array
    {
        retu

ublic static function formatter(string $value): string
    {
        return 'formatted ' . $value;
    }

    #[DataProvider('provider')]
    #[TestDoxFormatter('formatter')]
    public function testOne(string $value): void
    {
        $this->assertTrue(

rn [
            ['string'],
        ];
    }

    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\TestDox;

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

final class FormatterWithDataNameTest extends TestCase
{
    /**
     * @return non-empty

    public static function formatter(string $_dataName, string $value): string
    {
        return $_dataName . ': ' . $value;
    }

    #[DataProvider('provider')]
    #[TestDoxFormatter('formatter')]
    public function testOne(string $value): void

-array<non-empty-string, array{0: non-empty-string}>
     */
    public static function provider(): array
    {
        return [
            'first dataset'  => ['one'],
            'second dataset' => ['two'],
        ];
    }


* 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\TestDox;

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

#[TestDox('Text from class-level TestDox metadata')]
final class MetadataTest extends TestCase
{
    #[TestDox('Text from method-level TestDox metadata for successful test')]

        $this->assertTrue(true);
    }

    #[TestDox('Text from method-level TestDox metadata for failing test')]
    public function testSomethingThatDoesNotWork(): void
    {
        /* @noinspection PhpUnitAssertTrueWithIncompatibleTypeArgumentInspect

public function testSomethingThatWorks(): 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\TestDox;

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 OutcomeAndIssuesTest extends TestCase
{
    public function tes

gger_error('message', E_USER_DEPRECATED);
    }

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

        trigger_error('message', E_USER_NOTICE);
    }

    public function testSuccessButWarning(): void
    {

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

    public function testSuccessButRisky(): void
    {
    }

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

        tri


 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\Event\MyExtension;

use const PHP_EOL;
use PHPUnit\Event\TestRunner\ExecutionFinished;
use PHPUnit\Event\TestRunner\ExecutionFinishedSubscriber;

final readonly class MyExecutionFinishedSubscriber implements ExecutionFinishedSubscribe

e string $message;

    public function __construct(string $message)
    {
        $this->message = $message;
    }

    public function notify(ExecutionFinished $event): void
    {
        print __METHOD__ . PHP_EOL;
        print $this->message . PHP_EOL


 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\Event\MyExtension;

use PHPUnit\Runner\Extension\Extension;
use PHPUnit\Runner\Extension\Facade;
use PHPUnit\Runner\Extension\ParameterCollection;
use PHPUnit\TextUI\Configuration\Configuration;

final class MyExtensionBootstrap imple

n
{
    public function bootstrap(Configuration $configuration, Facade $facade, ParameterCollection $parameters): void
    {
        $facade->registerSubscriber(
            new MyExecutionFinishedSubscriber(
                'the-message',
            ),


 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\Event\MyExtension;

use const PHP_EOL;
use PHPUnit\Event\TestRunner\ExecutionFinished;
use PHPUnit\Event\TestRunner\ExecutionFinishedSubscriber;

final class MyExecutionFinishedSubscriber implements ExecutionFinishedSubscriber
{
    p

y string $message;

    public function __construct(string $message)
    {
        $this->message = $message;
    }

    public function notify(ExecutionFinished $event): void
    {
        print __METHOD__ . PHP_EOL;
        print $this->message . PHP_EOL


 that was distributed with this source code.
 */
namespace PHPUnit\Util;

use const DIRECTORY_SEPARATOR;
use const PHP_EOL;
use function str_repeat;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\TestCase;

#[CoversClass(Color::class)]
#[Small]
#[TestDox('Basic ANSI color highlighting support')]
final class ColorTest extends TestCase
{
    /**
     * @return a

      => ['fg-blue', 'string', "\x1b[34mstring\x1b[0m"],
            'multiple colors'          => ['bold,dim,fg-blue,bg-yellow', 'string', "\x1b[1;2;34;43mstring\x1b[0m"],
            'invalid color'            => ['fg-invalid', 'some text', 'some text'],

rray<string, array{string, string, string}>
     */
    public static function colorizeProvider(): array
    {
        return [
            'no color'                 => ['', 'string', 'string'],
            'one color'


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\Util;

use function realpath;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\TestCase;

#[CoversClass(ExcludeList::class)]
#[CoversClass(Invali

>assertContains(
            realpath(__DIR__ . '/../../../src'),
            $excludeList->getExcludedDirectories(),
        );
    }

    public function testExclusionOfFileCanBeQueried(): void
    {
        $excludeList = new ExcludeList(true);

dDirectoryException::class)]
#[Small]
#[RunTestsInSeparateProcesses]
final class ExcludeListTest extends TestCase
{
    public function testIsInitialized(): void
    {
        $excludeList = new ExcludeList(true);

        $this-


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\Util;

use const DIRECTORY_SEPARATOR;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\TestCase;

#[CoversClass(Filesystem::class)]
#[Small]
final class FilesystemTest extends TestCase

eamOrFile('socket://hostname:port'));
        $this->assertSame(__FILE__, Filesystem::resolveStreamOrFile(__FILE__));
        $this->assertSame(__DIR__ . DIRECTORY_SEPARATOR . 'does-not-exist', Filesystem::resolveStreamOrFile(__DIR__ . '/does-not-exist'));

{
    public function testCanResolveStreamOrFile(): void
    {
        $this->assertSame('php://stdout', Filesystem::resolveStreamOrFile('php://stdout'));
        $this->assertSame('socket://hostname:port', Filesystem::resolveStr


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\Util;

use Exception;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Exception as FrameworkException;
use PHPUnit\Framework\PhptAssertionFailedError;
use PHPUnit\Framework\TestCase;

#[CoversClass(Filter::class)]
#[Small]
final cla

>assertSame(Filter::stackTraceFromThrowableAsString($second), Filter::stackTraceFromThrowableAsString($first));
    }

    public function testStackTraceFromPhptAssertionFailedError(): void
    {
        $e = new PhptAssertionFailedError(
            'phpt

ss FilterTest extends TestCase
{
    public function testUnwrapThrowableUsesPreviousValues(): void
    {
        $first  = new Exception('first', 123, null);
        $second = new Exception('second', 345, $first);

        $this-


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

use function sprintf;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\TestCase;

#[CoversClass(GlobalState::class)]
#[CoversClass(GlobalStateResult::class)]
#[Small]
final class GlobalStateTest extends TestCase
{
    public function testIncludedFilesAsStringSkipsVfsProtocols(

5c7://' . $dir . '/TestClassTest.php',
            'file://' . $dir . '/XmlTest.php',
        ];

        $this->assertEquals(
            "require_once '" . $dir . "/GlobalStateTest.php';\n" .
            "require_once 'file://" . $dir . "/XmlTest.php';\n

): void
    {
        $dir   = __DIR__;
        $files = [
            'phpunit', // The 0 index is not used
            $dir . '/GlobalStateTest.php',
            'vfs://' . $dir . '/RegexTest.php',
            'phpvfs53e4626046


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\Util;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\TestCase;

#[CoversClass(Json::class)]
#[Small]
final class JsonTest extends TestCase
{

    /**
     * @return non-empty-list<array{string, string, bool}>
     */
    public static function canonicalizeProvider(): array
    {
        return [
            ['{"name":"John","age":"35"}', '{"age":"35","name":"John"}', f


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\Util;

use function realpath;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\TestCase;
use PHPUnit\TestFixture\BankAccountTest;
use PHPUnit\TestFixture\ConcreteTestClassExtendingAbstractTestClassWithoutTestSuffixTest;
use Reflectio

=> realpath(__DIR__ . '/../../_files/BankAccountTest.php'),
                'line' => 22,
            ],
            Reflection::sourceLocationFor(BankAccountTest::class, 'testBalanceIsInitiallyZero'),
        );
    }

    public function testFindsSourceL

nClass;

#[CoversClass(Reflection::class)]
#[Small]
final class ReflectionTest extends TestCase
{
    public function testFindsSourceLocationForMethod(): void
    {
        $this->assertSame(
            [
                'file'


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\Util;

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

#[CoversClass(Sanitizer::class)]
#[Small]
final class SanitizerTest extends TestCase
{
    /**
     * @return non-empty

            'U+202B RIGHT-TO-LEFT EMBEDDING'            => ["a\u{202B}b", 'a\u{202B}b'],
            'U+202C POP DIRECTIONAL FORMATTING'         => ["a\u{202C}b", 'a\u{202C}b'],
            'U+202D LEFT-TO-RIGHT OVERRIDE'             => ["a\u{202D}b", 'a\u

-list<array{0: string, 1: string}>
     */
    public static function bidirectionalControlCharacterProvider(): array
    {
        return [
            'U+202A LEFT-TO-RIGHT EMBEDDING'            => ["a\u{202A}b", 'a\u{202A}b'],


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\Util;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\TestCase;
use PHPUnit\TestFixture\TestCaseTest;
use ReflectionMethod;

#[CoversClass(

w ReflectionMethod(TestCaseTest::class, 'testOne')],
            [true, new ReflectionMethod(TestCaseTest::class, 'two')],
            [false, new ReflectionMethod(TestCaseTest::class, 'three')],
            [false, new ReflectionMethod(TestCaseTest::class

Test::class)]
#[Small]
final class TestTest extends TestCase
{
    /**
     * @return non-empty-list<array{bool, ReflectionMethod}>
     */
    public static function provider(): array
    {
        return [
            [true, ne


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\Util;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Framework\PhptAssertionFailedError;
use PHPUnit\Framework\TestCase;
use PHPUnit\Runner\ErrorExc

Case
{
    #[TestDox('Maps ExpectationFailedException with ComparisonFailure')]
    public function testMapsExpectationFailedExceptionWithComparisonFailure(): void
    {
        $comparisonFailure = new ComparisonFailure('expected', 'actual', 'expected', '

eption;
use RuntimeException;
use SebastianBergmann\Comparator\ComparisonFailure;

#[CoversClass(ThrowableToStringMapper::class)]
#[Small]
#[TestDox('ThrowableToStringMapper')]
final class ThrowableToStringMapperTest extends Test


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\Util;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\TestCase;

#[CoversClass(VersionComparisonOperator::class)]
#[

CoversClass(InvalidVersionOperatorException::class)]
#[Small]
final class VersionComparisonOperatorTest extends TestCase
{
    /**
     * @return non-empty-list<non-empty-list<string>>
     */
    public static function validValu


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\Util;

use function chr;
use function ord;
use function sprintf;
use DOMDocument;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\TestCase;
use PHPUnit\TextUI\

charProvider(): array
    {
        $data = [];

        for ($i = 0; $i < 256; $i++) {
            $data[] = [chr($i)];
        }

        return $data;
    }

    #[DataProvider('charProvider')]
    public function testPrepareString(string $char): void

XmlConfiguration\ValidationResult;

#[CoversClass(Xml::class)]
#[CoversClass(ValidationResult::class)]
#[Small]
final class XmlTest extends TestCase
{
    /**
     * @return list<array{string}>
     */
    public static function


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

use DOMDocument;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\TestCase;

#[CoversClass(Loader::class)]
#[Small]
final class LoaderTest extends TestCase
{
    public function testCanParseFileWithValidXml(): void
    {
        $document = (new Loader)->loadFile(__DIR__ .

ass);
        $this->expectExceptionMessageIs('Could not read XML from file "/does/not/exist.xml"');

        (new Loader)->loadFile('/does/not/exist.xml');
    }

    public function testCannotParseEmptyFile(): void
    {
        $this->expectException(Xm

 '/../../../_files/configuration.xml');

        $this->assertInstanceOf(DOMDocument::class, $document);
    }

    public function testCannotParseFileThatDoesNotExist(): void
    {
        $this->expectException(XmlException::cl


 that was distributed with this source code.
 */
namespace PHPUnit\Util\PHP;

use Generator;
use PHPUnit\Event\Emitter;
use PHPUnit\Event\Facade;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\TestRunner\ChildProcessResultProcessor;
use PHPUnit\Runner\CodeCoverage;
use PHPUnit\TestRunner\TestResult\PassedTests;

#[CoversClass(

  new Result('test', ''),
            new Job(
                <<<'EOT'
<?php declare(strict_types=1);
fwrite(STDOUT, 'test');

EOT
            ),
        ];

        yield 'output to stderr' => [
            new Result('', 'test'),
            new Job(

JobRunner::class)]
#[UsesClass(Job::class)]
#[UsesClass(Result::class)]
#[Small]
final class JobRunnerTest extends TestCase
{
    public static function provider(): Generator
    {
        yield 'output to stdout' => [


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

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\TestCase;

#[CoversClass(Job::class)]
#[Small]
final class JobTest extends TestCase
{
    public function testHasCode(): void
    {
        $code = 'the-code';

        $job = new Job(
            $code,
            [],

));
        $this->assertFalse($job->redirectErrors());
    }

    public function testMayHavePhpSettings(): void
    {
        $phpSettings = ['foo' => 'bar'];

        $job = new Job(
            'the-code',
            $phpSettings,
            [],

        [],
            [],
            null,
            false,
        );

        $this->assertSame($code, $job->code());

        $this->assertFalse($job->hasEnvironmentVariables());
        $this->assertFalse($job->hasInput(


clare(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\Util\PHP;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\TestCase;

#[CoversClass(Result::class)]
#[Small]
final class ResultTest extends TestCase
{
    public function testHasOutputFromS

t', $this->fixture()->stdout());
    }

    public function testHasOutputFromStderr(): void
    {
        $this->assertSame('stderr', $this->fixture()->stderr());
    }

    private function fixture(): Result
    {
        return new Result('stdout', 'stde

tdout(): void
    {
        $this->assertSame('stdou


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\Issue5884;

use const E_USER_DEPRECATED;
use function chmod;
use function file_get_contents;
use function file_put_contents;
use function sys_get_temp_dir;
use function tempnam;
use function trigger_error;
use function unlink;
use Exception;
use PHPUnit\Framework\Attributes\Ignor

{
        $this->expectUserDeprecationMessage('foo');

        trigger_error('foo', E_USER_DEPRECATED);
    }

    #[IgnoreDeprecations]
    public function testExpectUserDeprecationMessageANDIgnoringDeprecations(): void
    {
        $this->expectUserDepr

eDeprecations;
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
use PHPUnit\Framework\TestCase;

final class FooTest extends TestCase
{
    public function testExpectUserDeprecationMessageNOTIgnoringDeprecations(): 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 function restore_error_handler;
use function restore_exception_handler;
use function set_error_handler;
use function set_exception_handler;
use PHPUnit\Framework\TestCase;
use PHPUnit\Runner\ErrorHandler;
use Throwable;

class Issue5592TestIsolation extends TestCase
{
    p

previous);
        $this->assertTrue(true);
    }

    public function testAddedErrorHandler(): void
    {
        $previous = set_error_handler($this->addedErrorHandler(...));

        $this->assertInstanceOf(ErrorHandler::class, $previous);
        $this

ublic function testAddedAndRemovedErrorHandler(): void
    {
        $previous = set_error_handler($this->addedAndRemovedErrorHandler(...));
        restore_error_handler();

        $this->assertInstanceOf(ErrorHandler::class, $


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\Attributes\PreserveGlobalState;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
use PHPUnit\Framework\TestCase;

#[RunTestsInSeparateProcesses]
#[PreserveGlobalState(true)]
class Issue1335Test extends TestCase
{
    public function testGlobal

tion testGlobalIntFalsey(): void
    {
        $this->assertEquals(0, $GLOBALS['globalIntFalsey']);
    }

    public function testGlobalFloat(): void
    {
        $this->assertEquals(1.123, $GLOBALS['globalFloat']);
    }

    public function testGlobalB

String(): void
    {
        $this->assertEquals('Hello', $GLOBALS['globalString']);
    }

    public function testGlobalIntTruthy(): void
    {
        $this->assertEquals(1, $GLOBALS['globalIntTruthy']);
    }

    public func


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;

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

class Issue3093Test extends TestCase
{
    public static function someDataProvider(): array
    {
        return [['some v

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

    #[Depends('testFirstWithoutDependencies')]
    #[DataProvider('someDataProvider')]
    public function testSecondThatDependsOnFirstAndDataprovider($value): void
    {
        $this->as

alues']];
    }

    public function testFirstWithou


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\Issue5875;

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

final class Issue5875Test extends TestCase
{
    private static int $destructsDone = 0;

    public fu

econdTest(): void
    {
        $this->assertSame(1, self::$destructsDone);
    }

    #[Depends('testSecondTest')]
    #[TestWith([2])]
    #[TestWith([3])]
    #[TestWith([4])]
    public function testThirdTestWhichUsesDataProvider($numberOfTestsBeforeTh

nction __destruct()
    {
        self::$destructsDone++;
    }

    public function testFirstTest(): void
    {
        $this->assertSame(0, self::$destructsDone);
    }

    #[Depends('testFirstTest')]
    public function testS


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;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Framework\TestCase;
use SebastianBergmann\RecursionContext\InvalidArgumentException;
use stdClass;

class Issue2137Test extends Te

edException
     * @throws InvalidArgumentException
     */
    #[DataProvider('provideBrandService')]
    public function testBrandService($provided, $expected): void
    {
        $this->assertSame($provided, $expected);
    }

    /**
     * @throws \Ex

stCase
{
    public static function provideBrandService()
    {
        return [
            // [true, true]
            new stdClass, // not valid
        ];
    }

    /**
     * @throws Exception
     * @throws ExpectationFail


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\DiffContext;

use PHPUnit\Framework\TestCase;

final class DiffContextTest extends TestCase
{
    public function testMultiLineDiff(): void
    {
        $format = "line01\nline02\nline03\nline04\nline05\nline06\nline07\nline08\nline09\nline10\nl

7\nline18\nline19\nline20";
        $actual = "line01\nline02\nline03\nline04\nline05\nline06\nline07\nline08\nline09\nLINE10\nline11\nline12\nline13\nline14\nline15\nline16\nline17\nline18\nline19\nline20";

        $this->assertStringMatchesFormat($forma


* 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\TestDox;
use PHPUnit\Framework\TestCase;

final class CaseWithDollarSignTest extends TestCase
{
    public static function dataProvider(): iterable
    {
        yield ['$12.34'];

        yield ['Dollar sign followed by letter $Q'];

        yield ['Alone $ surrounded by spaces'];
    }

    #[DataProvider('dataProvider')]
    #[TestDox('The "$x" is used for this test')]
    public function testSomething(string $x): void
    {

yield ['Some text before the price $5.67'];


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\TestFixture\Event\RegisterSubscribers;

use PHPUnit\Runner\Extension\Extension;
use PHPUnit\Runner\Extension\Facade;
use PHPUnit\Runner\Extension\ParameterCollection;
use PHPUnit\TextUI\Configuration\Configuration;

final class MyExtensionBootstrap im

sion
{
    public function bootstrap(Configuration $configuration, Facade $facade, ParameterCollection $parameters): void
    {
        $facade->registerSubscribers(
            new MyExecutionStartedSubscriber,
            new MyExecutionFinishedSubscribe


 * (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\MyExtension;

use PHPUnit\Runner\Extension\Extension;
use PHPUnit\Runner\Extension\Facade;
use PHPUnit\Runner\Extension\ParameterCollection;
use PHPUnit\TextUI\Configuration\Configuration;

final class MyExtensionBootstrap implements Extension
{
    public function bootstrap(Configuration $co

rameters): void
    {
        $message = 'the-default-message';

        if ($parameters->has('message')) {
            $message = $parameters->get('message');
        }

        $facade->registerSubscriber(
            new MyExecutionFinishedSubscriber(

nfiguration, Facade $facade, ParameterCollection $pa


 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\Event\MyExtension;

use PHPUnit\Runner\Extension\Extension;
use PHPUnit\Runner\Extension\Facade;
use PHPUnit\Runner\Extension\ParameterCollection;
use PHPUnit\TextUI\Configuration\Configuration;

final class MyExtensionBootstrap imple

n
{
    public function bootstrap(Configuration $configuration, Facade $facade, ParameterCollection $parameters): void
    {
        $facade->registerSubscriber(
            new MyExecutionFinishedSubscriber(
                'the-message',
            ),


* 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\Phar;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use PHPUnit\Framework\Attributes\Ticket;
use PHPUnit\Framework\TestCase;

#[CoversClass(Greeter::class)]
final class GreeterTest extends TestCase
{
    publ

assertSame('Hello world!', (new Greeter)->greet());
    }

    #[RunInSeparateProcess]
    #[Ticket('https://github.com/sebastianbergmann/phpunit/issues/4412')]
    public function testGreetsInIsolation(): void
    {
        $this->assertSame('Hello world!

ic function testGreets(): void
    {
        $this->


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\Event;

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

final class TestForDeprecatedFeatureTest extends TestCase
{
    #[IgnoreDeprecations]
    public function testExpectationOnExactD

ction testExpectationsOnExactDeprecationMessagesWorkWhenExpectedDeprecationsAreTriggered(): void
    {
        $this->expectUserDeprecationMessage('message');
        $this->expectUserDeprecationMessage('another message');

        @trigger_error('message'

eprecationMessageWorksWhenExpectedDeprecationIsTriggered(): void
    {
        $this->expectUserDeprecationMessage('message');

        @trigger_error('message', E_USER_DEPRECATED);
    }

    #[IgnoreDeprecations]
    public fun


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\TestDox;

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

#[TestDox('Text from class-level TestDox metadata')]
final class DataProviderWithNumericDataSetNameAndMetadataWithPlacehol

    true,
                Foo::BAR,
                Bar::FOO,
            ],
        ];
    }

    #[DataProvider('provider')]
    #[TestDox('Text from method-level TestDox metadata for successful test with placeholders ($a, $b, $c, $d, $e, $f, $g)')]

dersTest extends TestCase
{
    public static function provider(): array
    {
        return [
            0 => [
                'string',
                0,
                0.0,
                ['key' => 'value'],


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\Issue5884;

use function error_get_last;
use function fopen;
use function is_array;
use function preg_match;
use Exception;

final class Foo
{
    public static function pcreHasUtf8Support()
    {
        // This regex deliberately has

ception.
        $download = @fopen($filename, 'wb');

        if ($download === false) {
            $error = error_get_last();

            if (!is_array($error)) {
                // Shouldn't be possible, but can happen in test situations.

 a compile error to demonstrate the issue.
        return (bool) @preg_match('/^.[/u', 'a');
    }

    public static function openFile($filename): void
    {
        // Silenced the PHP native warning in favour of throwing an ex


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\Issue6465;

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

final class Issue6465Test extends TestCase
{
    #[RunInSeparateProcess]
    public function testRequestTimeFloatIsNotInheritedFromParent(): void
    {
        $this->assertNot

this->assertNotSame(1, $_SERVER['REQUEST_TIME']);
    }

    #[RunInSeparateProcess]
    public function testScriptFilenameIsNotInheritedFromParent(): void
    {
        $this->assertNotSame('/fake/parent/script.php', $_SERVER['SCRIPT_FILENAME']);
    }
}

Same(1.0, $_SERVER['REQUEST_TIME_FLOAT']);
        $


* 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.
 */
$globalString                          = 'Hello';
$globalIntTruthy                       = 1;
$globalIntFalsey                       = 0;
$globalFloat                           = 1.123;
$globalBoolTrue                        = true;
$globalBoolFalse                       = false;
$globalNull

                     = ['foo'];
$globalNestedArray                     = [['foo']];
$globalObject                          = (object) ['foo' => 'bar'];
$globalObjectWithBackSlashString       = (object) ['foo' => 'back\\slash'];
$globalObjectWithDoubleBackS

                          = null;
$globalArray


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\Issue6408;

use IteratorAggregate;
use PHPUnit\Framework\TestCase;
use Traversable;

final class Issue6476Test extends TestCase
{
    public function testIteratorAggregate(): void
    {
        $this->assertCount(
            0,

         {
                public function __construct()
                {
                }

                public function getIterator(): Traversable
                {
                    return $this;
                }
            },
        );
    }
}


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\DiffContext;

use PHPUnit\Framework\TestCase;

final class EqualityDiffContextTest extends TestCase
{
    public function testArrayEquality(): void
    {
        $expected = [
            'key01' => 'val01',
            'key02' => '


 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\Event\MyExtension;

use const PHP_EOL;
use PHPUnit\Event\TestRunner\ExecutionFinished;
use PHPUnit\Event\TestRunner\ExecutionFinishedSubscriber;

final readonly class MyExecutionFinishedSubscriber implements ExecutionFinishedSubscribe

e string $message;

    public function __construct(string $message)
    {
        $this->message = $message;
    }

    public function notify(ExecutionFinished $event): void
    {
        print __METHOD__ . PHP_EOL;
        print $this->message . PHP_EOL


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\TestDox;

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

#[TestDox('Text from class-level TestDox metadata')]
final class DataProviderWithNumericDataSetNameAndMetadat

 true,
            ],
        ];
    }

    #[DataProvider('provider')]
    #[TestDox('Text from method-level TestDox metadata for successful test')]
    public function testSomethingThatWorks(string $a, int $b, float $c, array $d, bool $e): void
    {

aTest extends TestCase
{
    public static function provider(): array
    {
        return [
            0 => [
                'string',
                0,
                0.0,
                ['key' => 'value'],


 * (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;
use stdClass;

class Issue3156Test extends TestCase
{
    public static function dataSelectOperatorsProvider(): array
    {
        return [
            ['1'],
            ['2'

ts(): stdClass
    {
        $this->assertStringEndsWith('/', '/');

        return new stdClass;
    }

    #[Depends('testConstants')]
    #[DataProvider('dataSelectOperatorsProvider')]
    public function testDependsRequire(string $val, stdClass $obj):

],
        ];
    }

    public function testConstan