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 Issue5592Test extends TestCase
{
    public fun

;
        $this->assertTrue(true);
    }

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

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

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

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


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

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

:class);

        $this->assertTrue(true);
    }

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

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

    public function testIncomple

eption;

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


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

#[RunTestsInSeparateProcesses]
final class TestForDeprecatedFeature

;

        @trigger_error('message', E_USER_DEPRECATED);
    }

    #[IgnoreDeprecations]
    public function testExpectationsOnExactDeprecationMessagesWorkWhenExpectedDeprecationsAreTriggered(): void
    {
        $this->expectUserDeprecationMessage('mess

InIsolationTest extends TestCase
{
    #[IgnoreDeprecations]
    public function testExpectationOnExactDeprecationMessageWorksWhenExpectedDeprecationIsTriggered(): void
    {
        $this->expectUserDeprecationMessage('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;

use Exception;
use PHPUnit\Framework\TestCase;

class Foo6372
{
    public function doFoo(string $param): void
    {
    }
}

class Bar6372
{
    public function __construct(private readonly Foo6372 $foo)
    {
    }

    public func

nMockCallbackIsNotSwallowedByCodeUnderTest(): void
    {
        $mock = $this->createMock(Foo6372::class);

        $mock->expects($this->once())
            ->method('doFoo')
            ->willReturnCallback(function (string $param): void
            {

tion doBar(string $param): void
    {
        try {
            $this->foo->doFoo($param);
        } catch (Exception $e) {
        }
    }
}

final class Issue6372Test extends TestCase
{
    public function testAssertionFailureI


 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


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_EOL;
use function file_get_contents;
use function libxml_clear_errors;
use function libxml_get_errors;
use function libxml_use_internal_errors;
use function printf;
use function trim;
use DOMDocument;

function validate

schema/otr.xsd')) {
        print 'Generated XML document does not validate against Open Test Reporting schemas:' . PHP_EOL . PHP_EOL;

        foreach (libxml_get_errors() as $error) {
            printf(
                '- Line %d: %s' . PHP_EOL,

_and_print(string $logfile): void
{
    libxml_use_internal_errors(true);

    $document = new DOMDocument;
    $document->load($logfile);

    if (!$document->schemaValidate(__DIR__ . '/../../../../src/Logging/OpenTestReporting/


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 DataProviderWithNumericDataSetNameTest extends TestCase
{
    public static function provider(): array
    {
        return [

thingThatWorks(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): void
    {

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

    #[DataProvider('provider')]
    public function testSome


\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use stdClass;

#[CoversMethod(Assert::class, 'assertArraysAreIdenticalIgnoringOrder')]
#[TestDox('assertArraysAreIdenticalIgnoringOrder()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertArraysAreIdenticalIgnoringOrderTest extends TestCase
{
    /**
     * @return non-empty-array<non-empty-string, array{0: array<mixed>, 1: array<mixed>}>
     */
    public static function successProv

ider(): array
    {
        $object = new stdClass;

        return [
            'empty arrays' => [
                [],
                [],
            ],

            'implicit integer keys' => [
                ['a', 'b', 'c'


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProviderExternal;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(A

{
    #[DataProviderExternal(assertContainsOnlyInstancesOfTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(string $type, iterable $haystack): void
    {
        $this->assertContainsNotOnlyInstancesOf($type, $

ssert::class, 'assertContainsNotOnlyInstancesOf')]
#[TestDox('assertContainsNotOnlyInstancesOf()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyInstancesOfTest extends TestCase


ernal(assertContainsOnlyIntTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(iterable $haystack): void
    {
        $this->assertContainsNotOnlyInt($haystack);
    }

    #[DataProviderExternal(assertContainsOn

ssert::class, 'assertContainsNotOnlyInt')]
#[TestDox('assertContainsNotOnlyInt()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyIntTest extends TestCase
{
    #[DataProviderExt


DataProviderExternal(assertContainsOnlyIterableTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(iterable $haystack): void
    {
        $this->assertContainsNotOnlyIterable($haystack);
    }

    #[DataProvider

ssert::class, 'assertContainsNotOnlyIterable')]
#[TestDox('assertContainsNotOnlyIterable()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyIterableTest extends TestCase
{
    #[


External(assertContainsOnlyNullTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(iterable $haystack): void
    {
        $this->assertContainsNotOnlyNull($haystack);
    }

    #[DataProviderExternal(assertConta

ssert::class, 'assertContainsNotOnlyNull')]
#[TestDox('assertContainsNotOnlyNull()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyNullTest extends TestCase
{
    #[DataProvider


aProviderExternal(assertContainsOnlyNumericTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(iterable $haystack): void
    {
        $this->assertContainsNotOnlyNumeric($haystack);
    }

    #[DataProviderExter

ssert::class, 'assertContainsNotOnlyNumeric')]
#[TestDox('assertContainsNotOnlyNumeric()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyNumericTest extends TestCase
{
    #[Dat


oviderExternal(assertContainsOnlyObjectTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(iterable $haystack): void
    {
        $this->assertContainsNotOnlyObject($haystack);
    }

    #[DataProviderExternal(a

ssert::class, 'assertContainsNotOnlyObject')]
#[TestDox('assertContainsNotOnlyObject()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyObjectTest extends TestCase
{
    #[DataPr


DataProviderExternal(assertContainsOnlyResourceTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(iterable $haystack): void
    {
        $this->assertContainsNotOnlyResource($haystack);
    }

    #[DataProvider

ssert::class, 'assertContainsNotOnlyResource')]
#[TestDox('assertContainsNotOnlyResource()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyResourceTest extends TestCase
{
    #[


oviderExternal(assertContainsOnlyScalarTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(iterable $haystack): void
    {
        $this->assertContainsNotOnlyScalar($haystack);
    }

    #[DataProviderExternal(a

ssert::class, 'assertContainsNotOnlyScalar')]
#[TestDox('assertContainsNotOnlyScalar()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyScalarTest extends TestCase
{
    #[DataPr


oviderExternal(assertContainsOnlyStringTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(iterable $haystack): void
    {
        $this->assertContainsNotOnlyString($haystack);
    }

    #[DataProviderExternal(a

ssert::class, 'assertContainsNotOnlyString')]
#[TestDox('assertContainsNotOnlyString()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyStringTest extends TestCase
{
    #[DataPr


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assert

: iterable<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [[[]]],
        ];
    }

    /**
     * @return non-empty-list<array{0: iterable<mixed>}>
     */
    public static function failureProvider

ContainsOnlyArray')]
#[TestDox('assertContainsOnlyArray()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyArrayTest extends TestCase
{
    /**
     * @return non-empty-list<array{0


terable<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [[true]],
        ];
    }

    /**
     * @return non-empty-list<array{0: iterable<mixed>}>
     */
    public static function failureProvider(

ContainsOnlyBool')]
#[TestDox('assertContainsOnlyBool()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyBoolTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: i


t<array{0: iterable<mixed>}>
     */
    public static function successProvider(): array
    {
        $callable = static function (): void
        {};

        return [
            [[$callable]],
        ];
    }

    /**
     * @return non-empty-list<arr

ContainsOnlyCallable')]
#[TestDox('assertContainsOnlyCallable()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyCallableTest extends TestCase
{
    /**
     * @return non-empty-lis


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

use function fclose;
use function fopen;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDo

est extends TestCase
{
    /**
     * @return non-empty-list<array{0: iterable<mixed>}>
     */
    public static function successProvider(): array
    {
        $resource = fopen(__FILE__, 'r');

        fclose($resource);

        return [
            [[

x;

#[CoversMethod(Assert::class, 'assertContainsOnlyClosedResource')]
#[TestDox('assertContainsOnlyClosedResource()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyClosedResourceT


: iterable<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [[0.0]],
        ];
    }

    /**
     * @return non-empty-list<array{0: iterable<mixed>}>
     */
    public static function failureProvide

ContainsOnlyFloat')]
#[TestDox('assertContainsOnlyFloat()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyFloatTest extends TestCase
{
    /**
     * @return non-empty-list<array{0


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use stdClass;

#[CoversMethod(Assert::

* @return non-empty-list<array{0: class-string, 1: iterable<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [stdClass::class, [new stdClass]],
        ];
    }

    /**
     * @return non-empty-list<a

class, 'assertContainsOnlyInstancesOf')]
#[TestDox('assertContainsOnlyInstancesOf()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyInstancesOfTest extends TestCase
{
    /**


able<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [[0]],
        ];
    }

    /**
     * @return non-empty-list<array{0: iterable<mixed>}>
     */
    public static function failureProvider(): arr

ContainsOnlyInt')]
#[TestDox('assertContainsOnlyInt()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyIntTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: iter


t<array{0: iterable<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [[[]]],
        ];
    }

    /**
     * @return non-empty-list<array{0: iterable<mixed>}>
     */
    public static function failur

ContainsOnlyIterable')]
#[TestDox('assertContainsOnlyIterable()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyIterableTest extends TestCase
{
    /**
     * @return non-empty-lis


terable<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [[null]],
        ];
    }

    /**
     * @return non-empty-list<array{0: iterable<mixed>}>
     */
    public static function failureProvider(

ContainsOnlyNull')]
#[TestDox('assertContainsOnlyNull()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyNullTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: i


rray{0: iterable<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [['1.0']],
        ];
    }

    /**
     * @return non-empty-list<array{0: iterable<mixed>}>
     */
    public static function failur

ContainsOnlyNumeric')]
#[TestDox('assertContainsOnlyNumeric()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyNumericTest extends TestCase
{
    /**
     * @return non-empty-list<a


mpty-list<array{0: iterable<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [[new stdClass]],
        ];
    }

    /**
     * @return non-empty-list<array{0: iterable<mixed>}>
     */
    public stat

class, 'assertContainsOnlyObject')]
#[TestDox('assertContainsOnlyObject()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyObjectTest extends TestCase
{
    /**
     * @return non-e


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

use function fopen;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(As

return non-empty-list<array{0: iterable<mixed>}>
     */
    public static function successProvider(): array
    {
        $resource = fopen(__FILE__, 'r');

        return [
            [[$resource]],
        ];
    }

    /**
     * @return non-empty-lis

sert::class, 'assertContainsOnlyResource')]
#[TestDox('assertContainsOnlyResource()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyResourceTest extends TestCase
{
    /**
     * @


y{0: iterable<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [['string']],
        ];
    }

    /**
     * @return non-empty-list<array{0: iterable<mixed>}>
     */
    public static function failur

ContainsOnlyScalar')]
#[TestDox('assertContainsOnlyScalar()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyScalarTest extends TestCase
{
    /**
     * @return non-empty-list<arra


ContainsOnlyString')]
#[TestDox('assertContainsOnlyString()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsOnlyStringTest extends TestCase
{
    /**
     * @return non-empty-list<arra


terable<mixed>}>
     */
    public static function successProvider(): array
    {
        $a = new stdClass;

        return [
            [0, [0]],
            [0.0, [0.0]],
            [false, [false]],
            [null, [null]],
            ['string',

class, 'assertContains')]
#[TestDox('assertContains()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: mixed, 1: i


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

use function PHPUnit\TestFixture\Generator\f;
use ArrayIterator;
use Countable;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framewor

('framework/assertions')]
final class assertCountTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: int, 1: Countable|iterable<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [2, [

k\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertCount')]
#[CoversClass(GeneratorNotSupportedException::class)]
#[TestDox('assertCount()')]
#[Small]
#[Group('framework')]
#[Group


oviderExternal(assertDirectoryExistsTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(string $directory): void
    {
        $this->assertDirectoryDoesNotExist($directory);
    }

    #[DataProviderExternal(asse

ssert::class, 'assertDirectoryDoesNotExist')]
#[TestDox('assertDirectoryDoesNotExist()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertDirectoryDoesNotExistTest extends TestCase
{
    #[DataPr


empty-string}>
     */
    public static function successProvider(): array
    {
        return [
            [__DIR__],
        ];
    }

    /**
     * @return non-empty-list<array{0: non-empty-string}>
     */
    public static function failureProvider(

DirectoryExists')]
#[TestDox('assertDirectoryExists()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertDirectoryExistsTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: non-


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

use const DIRECTORY_SEPARATOR;
use const PHP_OS_FAMILY;
use function mkdir;
use function octdec;
use function rmdir;
use function sys_get_temp_dir;
use function uniqid;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group

up('framework/assertions')]
final class assertDirectoryIsNotReadableTest extends TestCase
{
    private string $directory;

    protected function setUp(): void
    {
        if (PHP_OS_FAMILY === 'Windows') {
            $this->markTestSkipped('Cannot tes

;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertDirectoryIsNotReadable')]
#[TestDox('assertDirectoryIsNotReadable()')]
#[Small]
#[Group('framework')]
#[Gro


up('framework/assertions')]
final class assertDirectoryIsNotWritableTest extends TestCase
{
    private string $directory;

    protected function setUp(): void
    {
        $this->directory = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid(__CLASS__ .

;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertDirectoryIsNotWritable')]
#[TestDox('assertDirectoryIsNotWritable()')]
#[Small]
#[Group('framework')]
#[Gro


amework/assertions')]
final class assertDirectoryIsReadableTest extends TestCase
{
    private string $directory;

    protected function setUp(): void
    {
        $this->directory = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid(__CLASS__ . '_', true

;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertDirectoryIsReadable')]
#[TestDox('assertDirectoryIsReadable()')]
#[Small]
#[Group('framework')]
#[Group('fr


amework/assertions')]
final class assertDirectoryIsWritableTest extends TestCase
{
    private string $directory;

    protected function setUp(): void
    {
        $this->directory = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid(__CLASS__ . '_', true

;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertDirectoryIsWritable')]
#[TestDox('assertDirectoryIsWritable()')]
#[Small]
#[Group('framework')]
#[Group('fr


 TestCase
{
    #[DataProviderExternal(assertMatchesRegularExpressionTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(string $pattern, string $string): void
    {
        $this->assertDoesNotMatchRegularExpress

ssert::class, 'assertDoesNotMatchRegularExpression')]
#[TestDox('assertDoesNotMatchRegularExpression()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertDoesNotMatchRegularExpressionTest extends


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\TestFixture\ObjectComparison\ValueObjectA;
use stdClass;

#[CoversMethod(Assert::class, 'assertArraysHaveEqualValuesIgnoringOrder')]
#[TestDox('assertArraysHaveEqualValuesIgnoringOrder()')]
#[Small]
#[Grou

/
    public static function successProvider(): array
    {
        $object = new stdClass;

        return [
            'empty arrays' => [
                [],
                [],
            ],

            'implicit integer keys' => [
                [

p('framework')]
#[Group('framework/assertions')]
final class assertArraysHaveEqualValuesIgnoringOrderTest extends TestCase
{
    /**
     * @return non-empty-array<non-empty-string, array{0: array<mixed>, 1: array<mixed>}>
     *


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use stdClass;

#[CoversMethod(Assert::class, 'assertArraysHaveIdenticalValuesIgnoringOrder')]
#[TestDox('assertArraysHaveIdenticalValuesIgnoringOrder()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')

r(): array
    {
        $object = new stdClass;

        return [
            'empty arrays' => [
                [],
                [],
            ],

            'implicit integer keys' => [
                ['a', 'b', 'c'],
                ['a', 'b',

]
final class assertArraysHaveIdenticalValuesIgnoringOrderTest extends TestCase
{
    /**
     * @return non-empty-array<non-empty-string, array{0: array<mixed>, 1: array<mixed>}>
     */
    public static function successProvide


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use stdClass;

#[CoversMethod(Assert::class, 'assertArraysHaveIdenticalValues')]
#[TestDox('assertArraysHaveIdenticalValues()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertArrays

stdClass;

        return [
            'empty arrays' => [
                [],
                [],
            ],

            'implicit integer keys' => [
                ['a', 'b', 'c'],
                ['a', 'b', 'c'],
            ],

            'expl

HaveIdenticalValuesTest extends TestCase
{
    /**
     * @return non-empty-array<non-empty-string, array{0: array<mixed>, 1: array<mixed>}>
     */
    public static function successProvider(): array
    {
        $object = new


External(assertContainsOnlyBoolTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(iterable $haystack): void
    {
        $this->assertContainsNotOnlyBool($haystack);
    }

    #[DataProviderExternal(assertConta

ssert::class, 'assertContainsNotOnlyBool')]
#[TestDox('assertContainsNotOnlyBool()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyBoolTest extends TestCase
{
    #[DataProvider


DataProviderExternal(assertContainsOnlyCallableTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(iterable $haystack): void
    {
        $this->assertContainsNotOnlyCallable($haystack);
    }

    #[DataProvider

ssert::class, 'assertContainsNotOnlyCallable')]
#[TestDox('assertContainsNotOnlyCallable()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyCallableTest extends TestCase
{
    #[


derExternal(assertContainsOnlyFloatTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(iterable $haystack): void
    {
        $this->assertContainsNotOnlyFloat($haystack);
    }

    #[DataProviderExternal(assert

ssert::class, 'assertContainsNotOnlyFloat')]
#[TestDox('assertContainsNotOnlyFloat()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyFloatTest extends TestCase
{
    #[DataProvi


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

use function iterator_to_array;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\TestFixture\TestBuilder\TestWithClassLevelIsolationAttributes;
use PHPUnit\TestFixture\TestBuilder\TestWithDataProvider;
use PHPUnit\TestFixture\TestBuilder\TestWithInheritedClassLevelIsolationAttribut

#[Small]
final class TestBuilderTest extends TestCase
{
    public function testBuildsTestWithoutMetadataForIsolation(): void
    {
        $test = (new TestBuilder)->build(
            new ReflectionClass(TestWithoutIsolationAttributes::class),

es;
use PHPUnit\TestFixture\TestBuilder\TestWithMethodLevelIsolationAttributes;
use PHPUnit\TestFixture\TestBuilder\TestWithoutIsolationAttributes;
use ReflectionClass;
use ReflectionProperty;

#[CoversClass(TestBuilder::class)]


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

use function sprintf;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\ExcludeGlobalVariableFromBackup;
use PHPUnit\TestFixture\TestWithDifferentNames;
use ReflectionMethod;
use stdClass;

#[CoversClass(TestCase::class)]
#[ExcludeGlobalVariableFromBackup('i')]
#[ExcludeGlobalVariableFromBackup('singleton')]
class TestCaseTest extends TestCase
{
    prote

, []];

        yield ["#0 with data ('foo', 'bar')", 0, ['foo', 'bar']];

        yield ["@dataSet with data ('foo', 'bar')", 'dataSet', ['foo', 'bar']];
    }

    public static function setUpBeforeClass(): void
    {
        $GLOBALS['a']  = 'a';

cted static int $testStatic = 456;

    /**
     * @return iterable<array{string, int|string, array<mixed>}>
     */
    public static function provideDataSetAsStringWithDataProvider(): iterable
    {
        yield ['', 'dataSet'


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

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\TestFixture\Success;

#[CoversClass(TestSuiteIterator::class)]
#[Small]
final class TestSuiteIteratorTest extends TestCase
{
    public function testKeyForEmptyTestSuiteInitiallyReturnsZero(): void
    {
        $testSuite = TestSuit

 $testSuite = TestSuite::empty('test suite name');
        $subject   = new TestSuiteIterator($testSuite);

        $this->assertFalse($subject->valid());
    }

    public function testKeyForNonEmptyTestSuiteInitiallyReturnsZero(): void
    {
        $sub

e::empty('test suite name');
        $subject   = new TestSuiteIterator($testSuite);

        $this->assertSame(0, $subject->key());
    }

    public function testValidForEmptyTestSuiteInitiallyReturnsFalse(): void
    {


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

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

#[CoversClass(Exception::class)]
#[Small]
final class ExceptionTest extends TestCase
{
    public function testExceptionSerialize(): void
    {
        $actual = (new Exception)

ual);
        $this->assertArrayHasKey('serializableTrace', $actual);
        $this->assertArrayHasKey('message', $actual);
        $this->assertArrayHasKey('code', $actual);
        $this->assertArrayHasKey('file', $actual);
        $this->assertArrayHasK

->__serialize();

        $this->assertCount(5, $act


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

use PHPUnit\Event\Emitter;
use PHPUnit\Event\Facade;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\TestRunner\ChildProcessResultProcessor;
use PHPUnit\Runner\CodeCoverage;
use PHPUnit\TestFixture\Success;
use PHPUnit\TestRunner

 public function testEmitsErrorEventWhenStderrIsNotEmpty(): void
    {
        $emitter = $this->createMock(Emitter::class);

        $emitter
            ->expects($this->once())
            ->method('testErrored')
            ->seal();

        $this->pr

\TestResult\PassedTests;

#[CoversClass(ChildProcessResultProcessor::class)]
#[Small]
final class ChildProcessResultProcessorTest extends TestCase
{
    #[TestDox('Emits Test\Errored event when standard output is not empty')]


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

use function file_get_contents;
use function preg_match_all;
use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversNothing]
#[TestDox('Global Assertion Functions'

 array
    {
        preg_match_all(
            '/public static function (assert[^ (]+)/',
            file_get_contents(
                __DIR__ . '/../../../../src/Framework/Assert.php',
            ),
            $matches,
        );

        $function

)]
final class FunctionsTest extends TestCase
{
    private static array $globalAssertionFunctions = [];

    /**
     * @return array<string, array{string}>
     */
    public static function provideStaticAssertionMethodNames():


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertArrayIsEqualToArrayIgnorin

  * @return non-empty-list<array{0: array<mixed>, 1: array<mixed>, 2: array<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [
                ['a' => 'b', 'b' => 'c', 0 => 1, 1 => 2],

gListOfKeys')]
#[TestDox('assertArrayIsEqualToArrayIgnoringListOfKeys()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertArrayIsEqualToArrayIgnoringListOfKeysTest extends TestCase
{
    /**


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertArrayIsIdenticalToArrayIgn

    /**
     * @return non-empty-list<array{0: array<mixed>, 1: array<mixed>, 2: array<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [
                ['a' => 'b', 'b' => 'c', 0 => 1, 1 => 2],

oringListOfKeys')]
#[TestDox('assertArrayIsIdenticalToArrayIgnoringListOfKeys()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertArrayIsIdenticalToArrayIgnoringListOfKeysTest extends TestCase
{


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

use ArrayAccess;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProviderExternal;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

erExternal(assertArrayHasKeyTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(int|string $key, array|ArrayAccess $array): void
    {
        $this->assertArrayNotHasKey($key, $array);
    }

    #[DataProviderEx

#[CoversMethod(Assert::class, 'assertArrayNotHasKey')]
#[TestDox('assertArrayNotHasKey()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertArrayNotHasKeyTest extends TestCase
{
    #[DataProvid


\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\TestFixture\ObjectComparison\ChildOfValueObjectA;
use PHPUnit\TestFixture\ObjectComparison\SameStructAsValueObjectA;
use PHPUnit\TestFixture\ObjectComparison\ValueObjectA;
use stdClass;

#[CoversMethod(Assert::class, 'assertArraysAreEqual')]
#[TestDox('assertArraysAreEqual()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertArraysAreEqualTest extends TestCase
{
    /**

  * @return non-empty-array<non-empty-string, array{0: array<mixed>, 1: array<mixed>}>
     */
    public static function successProvider(): array
    {
        $object = new stdClass;

        return [
            'empty arrays'


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use stdClass;

#[CoversMethod(Assert::class, 'assertArraysHaveEqualValues')]
#[TestDox('assertArraysHaveEqualValues()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertArraysHaveEqua

       return [
            'empty arrays' => [
                [],
                [],
            ],

            'implicit integer keys' => [
                ['a', 'b', 'c'],
                ['a', 'b', 'c'],
            ],

            'explicit integer

lValuesTest extends TestCase
{
    /**
     * @return non-empty-array<non-empty-string, array{0: array<mixed>, 1: array<mixed>}>
     */
    public static function successProvider(): array
    {
        $object = new stdClass;


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

use DateInterval;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use stdClass;

#[CoversMethod(Assert::class, '

ixed, 1: iterable<mixed>}>
     */
    public static function successProvider(): array
    {
        $a      = new stdClass;
        $a->foo = 'bar';

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

        return [
            [0, [0]],

assertContainsEquals')]
#[TestDox('assertContainsEquals()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsEqualsTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: m


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProviderExternal;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(A

 TestCase
{
    #[DataProviderExternal(assertContainsOnlyClosedResourceTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(iterable $haystack): void
    {
        $this->assertContainsNotOnlyClosedResource($haysta

ssert::class, 'assertContainsNotOnlyClosedResource')]
#[TestDox('assertContainsNotOnlyClosedResource()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyClosedResourceTest extends


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

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

#[CoversClass(TestSize::class)]
#[CoversClassesThatExtendClass(TestSize::class)]
#[Small]
fin

reater than small test' => [
                false,
                TestSize::small(),
                TestSize::small(),
            ],

            'small test is not greater than medium test' => [
                false,
                TestSize::small()

al class TestSizeTest extends TestCase
{
    /**
     * @return array<string, array{bool, TestSize, TestSize}>
     */
    public static function comparisonProvider(): array
    {
        return [
            'small test is not g


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

#[CoversClass(TestStatus::class)]
#[CoversClassesThatExtendClass(TestStatus::class)]
#[Small]
final class TestStatusTest extends TestCase
{
    public function testCanBeUnknown(): void
    {
        $status = TestStatus::unknown();

        $this->assertFalse($status->isKnown());
        $this->assertTrue($status->isUnknown());
        $this->assertFalse($status->isSuccess());
        $this->assertFalse($status->isFailure());
        $this->

());
        $this->assertFalse($status->isDeprecation());
        $this->assertFalse($status->isNotice());

        $this->assertSame('unknown', $status->asString());
    }

    public function testCanBeSuccess(): void
    {
        $status = TestStatus::

assertFalse($status->isError());
        $this->assertFalse($status->isWarning());
        $this->assertFalse($status->isRisky());
        $this->assertFalse($status->isIncomplete());
        $this->assertFalse($status->isSkipped


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

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\PreserveGlobalState;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\TestRunner\ErrorHandlerBootstrapper;
use PHPUnit\Runner\ErrorHandler;
us

TextUI\CliArguments\Builder;
use PHPUnit\TextUI\Configuration\Configuration;
use PHPUnit\TextUI\Configuration\Merger;
use PHPUnit\TextUI\XmlConfiguration\Loader;
use ReflectionClass;

#[CoversClass(ErrorHandlerBootstrapper::class)]
#[Small]
final class Err

e PHPUnit\Runner\IssueTriggerResolver\DefaultResolver;
use PHPUnit\Runner\IssueTriggerResolver\Resolver;
use PHPUnit\TestFixture\IssueTriggerResolver\ResolverA;
use PHPUnit\TestFixture\IssueTriggerResolver\ResolverB;
use PHPUnit\


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertArrayIsEqualToArrayOnlyCon

estCase
{
    /**
     * @return non-empty-list<array{0: array<mixed>, 1: array<mixed>, 2: array<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [
                ['a' => 'b', 'b' => 'c', 0 => 1, 1 =>

sideringListOfKeys')]
#[TestDox('assertArrayIsEqualToArrayOnlyConsideringListOfKeys()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertArrayIsEqualToArrayOnlyConsideringListOfKeysTest extends T


\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\TestFixture\ObjectComparison\ChildOfValueObjectA;
use PHPUnit\TestFixture\ObjectComparison\SameStructAsValueObjectA;
use PHPUnit\TestFixture\ObjectComparison\ValueObjectA;
use stdClass;

#[CoversMethod(Assert::class, 'assertArraysAreEqualIgnoringOrder')]
#[TestDox('assertArraysAreEqualIgnoringOrder()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertArraysAreEqualIgnoringO

    return [
            'empty arrays' => [
                [],
                [],
            ],

            'implicit integer keys' => [
                ['a', 'b', 'c'],
                ['a', 'b', 'c'],
            ],

            'explicit integer ke

rderTest extends TestCase
{
    /**
     * @return non-empty-array<non-empty-string, array{0: array<mixed>, 1: array<mixed>}>
     */
    public static function successProvider(): array
    {
        $object = new stdClass;


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use stdClass;

#[CoversMethod(Assert::class, 'assertArraysAreIdentical')]
#[TestDox('assertArraysAreIdentical()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertArraysAreIdenticalTe

turn [
            'empty arrays' => [
                [],
                [],
            ],

            'implicit integer keys' => [
                ['a', 'b', 'c'],
                ['a', 'b', 'c'],
            ],

            'explicit integer keys' =>

st extends TestCase
{
    /**
     * @return non-empty-array<non-empty-string, array{0: array<mixed>, 1: array<mixed>}>
     */
    public static function successProvider(): array
    {
        $object = new stdClass;

        re


it\TestFixture\DependencySuccessTest;
use stdClass;

#[CoversClass(ExecutionOrderDependency::class)]
#[Small]
class ExecutionOrderDependencyTest extends TestCase
{
    public function testCanBeInvalid(): void
    {
        $dependency = ExecutionOrderDependency::invalid();

        $this->assertFalse($dependency->isValid());
        $this->assertSame('', $dependency->getTarget());
        $this->assertSame('', (string) $dependency);
        $this->assertSame('', $dependency->getTargetClassName());
        $

 false, false);
        $dependency = ExecutionOrderDependency::forClass($metadata);

        $this->assertTrue($dependency->isValid());
        $this->assertTrue($dependency->targetIsClass());
        $this->assertSame('SomeClass::class', $dependency->get

this->assertFalse($dependency->shallowClone());
        $this->assertFalse($dependency->deepClone());
    }

    public function testCanBeDependencyOnClass(): void
    {
        $metadata   = Metadata::dependsOnClass('SomeClass',


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

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\PreserveGlobalState;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Frame

 #[TestDox('Returns empty string when test expects output and STDOUT is not rewindable')]
    #[RunInSeparateProcess]
    #[PreserveGlobalState(false)]
    public function testReturnsEmptyStringWhenTestExpectsOutput(): void
    {
        $test = new Succes

work\TestRunner\ChildProcessOutputCollector;
use PHPUnit\TestFixture\Success;
use ReflectionProperty;

#[CoversClass(ChildProcessOutputCollector::class)]
#[Small]
final class ChildProcessOutputCollectorTest extends TestCase
{


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

use ArrayAccess;
use ArrayObject;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\TestFixture\Sample

 * @return non-empty-list<array{0: int|string, 1: array<mixed>|ArrayAccess<array-key, mixed>}>
     */
    public static function successProvider(): array
    {
        $arrayAccess        = new SampleArrayAccess;
        $arrayAccess['foo'] = 'bar';

ArrayAccess;

#[CoversMethod(Assert::class, 'assertArrayHasKey')]
#[TestDox('assertArrayHasKey()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertArrayHasKeyTest extends TestCase
{
    /**


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

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\TestFixture\AbstractTestCase;
use PHPUnit\TestFixture\DependencyFailureTest;
use PHPUnit\TestFixture\DependencyOnClassTest;
use PHPUnit\TestFixture\DependencySuccessTest;
use PHPUnit\TestFixture\MultiDependencyTest;
use PHPUnit\TestFixture\NoTestCase;
use PHPUnit\TestFixture\NotPublicTestCase;
use ReflectionClass;

#[CoversClass(Test

$this->assertCount(1, $suite);
    }

    public function testNormalizeProvidedDependencies(): void
    {
        $suite = TestSuite::fromClassReflector(new ReflectionClass(MultiDependencyTest::class));

        $this->assertEquals([
            MultiDepen

Suite::class)]
#[Small]
final class TestSuiteTest extends TestCase
{
    public function testNotPublicTestCase(): void
    {
        $suite = TestSuite::fromClassReflector(new ReflectionClass(NotPublicTestCase::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\Framework;

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertArrayIsIdenticalToArrayOnl

st extends TestCase
{
    /**
     * @return non-empty-list<array{0: array<mixed>, 1: array<mixed>, 2: array<mixed>}>
     */
    public static function successProvider(): array
    {
        return [
            [
                ['a' => 'b', 'b' => 'c',

yConsideringListOfKeys')]
#[TestDox('assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertArrayIsIdenticalToArrayOnlyConsideringListOfKeysTe


derExternal(assertContainsOnlyArrayTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(iterable $haystack): void
    {
        $this->assertContainsNotOnlyArray($haystack);
    }

    #[DataProviderExternal(assert

ssert::class, 'assertContainsNotOnlyArray')]
#[TestDox('assertContainsNotOnlyArray()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertContainsNotOnlyArrayTest extends TestCase
{
    #[DataProvi


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFileMatchesFormatFile')]
#[T

(): void
    {
        $this->assertFileMatchesFormatFile(
            TEST_FILES_PATH . 'expectedFileFormat.txt',
            TEST_FILES_PATH . 'expectedFileFormat.txt',
        );
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void

estDox('assertFileMatchesFormatFile()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertFileMatchesFormatFileTest extends TestCase
{
    public function testSucceedsWhenConstraintEvaluatesToTrue


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

use function fclose;
use function fopen;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDo

-empty-list<array{0: mixed}>
     */
    public static function failureProvider(): array
    {
        $openResource = fopen(__FILE__, 'r');

        $closedResource = fopen(__FILE__, 'r');
        fclose($closedResource);

        return [
            [[]

x;
use stdClass;

#[CoversMethod(Assert::class, 'assertIsInt')]
#[TestDox('assertIsInt()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsIntTest extends TestCase
{
    /**
     * @return non


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

use function fclose;
use function fopen;
use ArrayIterator;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framewor

tCase
{
    /**
     * @return non-empty-list<array{0: mixed}>
     */
    public static function successProvider(): array
    {
        return [
            [[]],
            [new ArrayIterator([])],
        ];
    }

    /**
     * @return non-empty-list

k\Attributes\TestDox;
use stdClass;

#[CoversMethod(Assert::class, 'assertIsIterable')]
#[TestDox('assertIsIterable()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsIterableTest extends Tes


non-empty-list<array{0: mixed}>
     */
    public static function failureProvider(): array
    {
        $openResource = fopen(__FILE__, 'r');

        $closedResource = fopen(__FILE__, 'r');
        fclose($closedResource);

        return [

x;
use stdClass;

#[CoversMethod(Assert::class, 'assertIsList')]
#[TestDox('assertIsList()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsListTest extends TestCase
{
    /**
     * @return


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProviderExternal;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[Cover

rrayTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(mixed $actual): void
    {
        $this->assertIsNotArray($actual);
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void
    {

sMethod(Assert::class, 'assertIsNotArray')]
#[TestDox('assertIsNotArray()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsNotArrayTest extends TestCase
{
    #[DataProviderExternal(assertIsA


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProviderExternal;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMe

t::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(mixed $actual): void
    {
        $this->assertIsNotBool($actual);
    }

    #[DataProviderExternal(assertIsBoolTest::class, 'successProvider')]
    public functi

thod(Assert::class, 'assertIsNotBool')]
#[TestDox('assertIsNotBool()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsNotBoolTest extends TestCase
{
    #[DataProviderExternal(assertIsBoolTes


ertIsCallableTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(mixed $actual): void
    {
        $this->assertIsNotCallable($actual);
    }

    #[DataProviderExternal(assertIsCallableTest::class, 'successProvi

thod(Assert::class, 'assertIsNotCallable')]
#[TestDox('assertIsNotCallable()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsNotCallableTest extends TestCase
{
    #[DataProviderExternal(ass


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

use function fclose;
use function fopen;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProviderExternal;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framew

est extends TestCase
{
    #[DataProviderExternal(assertIsClosedResourceTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(mixed $actual): void
    {
        $this->assertIsNotClosedResource($actual);
    }

ork\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertIsNotClosedResource')]
#[TestDox('assertIsNotClosedResource()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsNotClosedResourceT


loatTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(mixed $actual): void
    {
        $this->assertIsNotFloat($actual);
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void
    {

sMethod(Assert::class, 'assertIsNotFloat')]
#[TestDox('assertIsNotFloat()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsNotFloatTest extends TestCase
{
    #[DataProviderExternal(assertIsF


::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(mixed $actual): void
    {
        $this->assertIsNotInt($actual);
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void
    {
        $this->ex

sMethod(Assert::class, 'assertIsNotInt')]
#[TestDox('assertIsNotInt()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsNotIntTest extends TestCase
{
    #[DataProviderExternal(assertIsIntTest


ertIsIterableTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(mixed $actual): void
    {
        $this->assertIsNotIterable($actual);
    }

    #[DataProviderExternal(assertIsIterableTest::class, 'successProvi

thod(Assert::class, 'assertIsNotIterable')]
#[TestDox('assertIsNotIterable()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsNotIterableTest extends TestCase
{
    #[DataProviderExternal(ass


IsNumericTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(mixed $actual): void
    {
        $this->assertIsNotNumeric($actual);
    }

    #[DataProviderExternal(assertIsNumericTest::class, 'successProvider')]

thod(Assert::class, 'assertIsNotNumeric')]
#[TestDox('assertIsNotNumeric()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsNotNumericTest extends TestCase
{
    #[DataProviderExternal(assert


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProviderExternal;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use stdClas

rnal(assertIsObjectTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(mixed $actual): void
    {
        $this->assertIsNotObject($actual);
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): vo

s;

#[CoversMethod(Assert::class, 'assertIsNotObject')]
#[TestDox('assertIsNotObject()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsNotObjectTest extends TestCase
{
    #[DataProviderExte


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

use const PHP_OS_FAMILY;
use function chmod;
use function mkdir;
use function octdec;
use function rmdir;
use function unlink;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProviderExternal;
use PHPUnit\Framework\Att

ramework/assertions')]
final class assertIsNotReadableTest extends TestCase
{
    private ?string $directory = null;
    private ?string $file      = null;

    protected function tearDown(): void
    {
        if ($this->directory !== null) {

ributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertIsNotReadable')]
#[TestDox('assertIsNotReadable()')]
#[Small]
#[Group('framework')]
#[Group('f


ertIsResourceTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(mixed $actual): void
    {
        $this->assertIsNotResource($actual);
    }

    #[DataProviderExternal(assertIsResourceTest::class, 'successProvi

thod(Assert::class, 'assertIsNotResource')]
#[TestDox('assertIsNotResource()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsNotResourceTest extends TestCase
{
    #[DataProviderExternal(ass


calarTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(mixed $actual): void
    {
        $this->assertIsNotScalar($actual);
    }

    #[DataProviderExternal(assertIsScalarTest::class, 'successProvider')]
    p

thod(Assert::class, 'assertIsNotScalar')]
#[TestDox('assertIsNotScalar()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsNotScalarTest extends TestCase
{
    #[DataProviderExternal(assertIsS


IsStringTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(mixed $actual): void
    {
        $this->assertIsNotString($actual);
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void
    {

sMethod(Assert::class, 'assertIsNotString')]
#[TestDox('assertIsNotString()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsNotStringTest extends TestCase
{
    #[DataProviderExternal(assert


ramework/assertions')]
final class assertIsNotWritableTest extends TestCase
{
    private ?string $directory = null;
    private ?string $file      = null;

    protected function tearDown(): void
    {
        if ($this->directory !== null) {

ributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertIsNotWritable')]
#[TestDox('assertIsNotWritable()')]
#[Small]
#[Group('framework')]
#[Group('f


 @return non-empty-list<array{0: mixed}>
     */
    public static function successProvider(): array
    {
        return [
            ['123'],
            ['123.456'],
        ];
    }

    /**
     * @return non-empty-list<array{0: mixed}>
     */
    p

x;
use stdClass;

#[CoversMethod(Assert::class, 'assertIsNumeric')]
#[TestDox('assertIsNumeric()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsNumericTest extends TestCase
{
    /**
     *


eturn non-empty-list<array{0: mixed}>
     */
    public static function failureProvider(): array
    {
        $openResource = fopen(__FILE__, 'r');

        $closedResource = fopen(__FILE__, 'r');
        fclose($closedResource);

        return [

x;
use stdClass;

#[CoversMethod(Assert::class, 'assertIsObject')]
#[TestDox('assertIsObject()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsObjectTest extends TestCase
{
    /**
     * @r


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

use const DIRECTORY_SEPARATOR;
use const PHP_OS_FAMILY;
use function chmod;
use function mkdir;
use function octdec;
use function rmdir;
use function sys_get_temp_dir;
use function tempnam;
use function uniqid;
use function unlink;
use PHPUnit\Framework\Attributes\CoversMethod;
u

('assertIsReadable()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsReadableTest extends TestCase
{
    private ?string $directory = null;
    private ?string $file      = null;

    /**
     * @return non-empty-list

se PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertIsReadable')]
#[TestDox


  * @return non-empty-list<array{0: mixed}>
     */
    public static function successProvider(): array
    {
        $openResource = fopen(__FILE__, 'r');

        $closedResource = fopen(__FILE__, 'r');
        fclose($closedResource);

        return [

x;
use stdClass;

#[CoversMethod(Assert::class, 'assertIsResource')]
#[TestDox('assertIsResource()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsResourceTest extends TestCase
{
    /**


eturn non-empty-list<array{0: mixed}>
     */
    public static function successProvider(): array
    {
        return [
            [true],
            [false],
            [0],
            [0.0],
            ['string'],
        ];
    }

    /**
     * @

x;
use stdClass;

#[CoversMethod(Assert::class, 'assertIsScalar')]
#[TestDox('assertIsScalar()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsScalarTest extends TestCase
{
    /**
     * @r


x;
use stdClass;

#[CoversMethod(Assert::class, 'assertIsString')]
#[TestDox('assertIsString()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsStringTest extends TestCase
{
    /**
     * @r


('assertIsWritable()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsWritableTest extends TestCase
{
    private ?string $directory = null;
    private ?string $file      = null;

    /**
     * @return non-empty-list

se PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertIsWritable')]
#[TestDox


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertJsonFileEqualsJsonFile')]
#[TestDo

 void
    {
        $this->assertJsonFileEqualsJsonFile(
            TEST_FILES_PATH . 'JsonData/simpleObject.json',
            TEST_FILES_PATH . 'JsonData/simpleObject.json',
        );
    }

    public function testFailsWhenConstraintEvaluatesToFalse()

x('assertJsonFileEqualsJsonFile()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertJsonFileEqualsJsonFileTest extends TestCase
{
    public function testSucceedsWhenConstraintEvaluatesToTrue():


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertJsonFileNotEqualsJsonFile')]
#[Tes

ToTrue(): void
    {
        $this->assertJsonFileNotEqualsJsonFile(
            TEST_FILES_PATH . 'JsonData/arrayObject.json',
            TEST_FILES_PATH . 'JsonData/simpleObject.json',
        );
    }

    public function testFailsWhenConstraintEvaluat

tDox('assertJsonFileNotEqualsJsonFile()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertJsonFileNotEqualsJsonFileTest extends TestCase
{
    public function testSucceedsWhenConstraintEvaluates


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

use function json_encode;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertJsonStri

WhenConstraintEvaluatesToTrue(): void
    {
        $this->assertJsonStringEqualsJsonFile(
            TEST_FILES_PATH . 'JsonData/simpleObject.json',
            json_encode(['Mascott' => 'Tux']),
        );
    }

    public function testFailsWhenConstra

ngEqualsJsonFile')]
#[TestDox('assertJsonStringEqualsJsonFile()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertJsonStringEqualsJsonFileTest extends TestCase
{
    public function testSucceeds


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assert

turn non-empty-list<array{0: non-empty-string, 1: non-empty-string}>
     */
    public static function successProvider(): array
    {
        return [
            ['{"Mascot" : "elePHPant"}', '{"Mascot" : "elePHPant"}'],
        ];
    }

    /**
     * @

JsonStringEqualsJsonString')]
#[TestDox('assertJsonStringEqualsJsonString()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertJsonStringEqualsJsonStringTest extends TestCase
{
    /**
     * @re


tSucceedsWhenConstraintEvaluatesToTrue(): void
    {
        $this->assertJsonStringNotEqualsJsonFile(
            TEST_FILES_PATH . 'JsonData/arrayObject.json',
            json_encode(['Mascott' => 'Tux']),
        );
    }

    public function testFails

ngNotEqualsJsonFile')]
#[TestDox('assertJsonStringNotEqualsJsonFile()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertJsonStringNotEqualsJsonFileTest extends TestCase
{
    public function tes


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProviderExternal;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(A

 TestCase
{
    #[DataProviderExternal(assertJsonStringEqualsJsonStringTest::class, 'failureProvider')]
    public function testSucceedsWhenConstraintEvaluatesToTrue(string $expectedJson, string $actualJson): void
    {
        $this->assertJsonStringNotEq

ssert::class, 'assertJsonStringNotEqualsJsonString')]
#[TestDox('assertJsonStringNotEqualsJsonString()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertJsonStringNotEqualsJsonStringTest extends


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertJson')]
#[TestDox('assertJson()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class asser

tSucceedsWhenConstraintEvaluatesToTrue(): void
    {
        $this->assertJson('{}');
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void
    {
        $this->expectException(AssertionFailedError::class);

        $this->assertJson('

tJsonTest extends TestCase
{
    public function tes


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::c

array{0: int, 1: int}>
     */
    public static function successProvider(): array
    {
        return [
            [2, 1],
            [2, 2],
        ];
    }

    #[DataProvider('successProvider')]
    public function testSucceedsWhenConstraintEvaluat

lass, 'assertLessThanOrEqual')]
#[TestDox('assertLessThanOrEqual()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertLessThanOrEqualTest extends TestCase
{
    /**
     * @return non-empty-list<


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFileNotEqualsCanonicalizing'

intEvaluatesToTrue(): void
    {
        $this->assertFileNotEqualsCanonicalizing(
            TEST_FILES_PATH . 'foo.xml',
            TEST_FILES_PATH . 'bar.xml',
        );
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void
    {

)]
#[TestDox('assertFileNotEqualsCanonicalizing()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertFileNotEqualsCanonicalizingTest extends TestCase
{
    public function testSucceedsWhenConstra


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFileNotEqualsIgnoringCase')]

luatesToTrue(): void
    {
        $this->assertFileNotEqualsIgnoringCase(
            TEST_FILES_PATH . 'foo.xml',
            TEST_FILES_PATH . 'bar.xml',
        );
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void
    {

#[TestDox('assertFileNotEqualsIgnoringCase()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertFileNotEqualsIgnoringCaseTest extends TestCase
{
    public function testSucceedsWhenConstraintEva


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

use const INF;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFinite')]
#[TestDox('assertFinite()')]
#[Small]
#[Group('framework')]
#[Group

st extends TestCase
{
    public function testSucceedsWhenConstraintEvaluatesToTrue(): void
    {
        $this->assertFinite(1);
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void
    {
        $this->expectException(AssertionFaile

('framework/assertions')]
final class assertFiniteTe


pty-list<array{0: int, 1: int}>
     */
    public static function successProvider(): array
    {
        return [
            [1, 2],
            [2, 2],
        ];
    }

    #[DataProvider('successProvider')]
    public function testSucceedsWhenConstrai

lass, 'assertGreaterThanOrEqual')]
#[TestDox('assertGreaterThanOrEqual()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertGreaterThanOrEqualTest extends TestCase
{
    /**
     * @return non-em


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

use const INF;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertInfinite')]
#[TestDox('assertInfinite()')]
#[Small]
#[Group('framework')]
#[G

niteTest extends TestCase
{
    public function testSucceedsWhenConstraintEvaluatesToTrue(): void
    {
        $this->assertInfinite(INF);
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void
    {
        $this->expectException(Asse

roup('framework/assertions')]
final class assertInfi


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

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use stdClass;

#[C

Test extends TestCase
{
    /**
     * @return non-empty-list<array{0: non-empty-string, 1: mixed}>
     */
    public static function successProvider(): array
    {
        return [
            [stdClass::class, new stdClass],
        ];
    }

    /**

oversMethod(Assert::class, 'assertInstanceOf')]
#[CoversClass(UnknownClassOrInterfaceException::class)]
#[TestDox('assertInstanceOf()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertInstanceOf


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

use function fclose;
use function fopen;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use stdClass;

#[Covers

<array{0: mixed}>
     */
    public static function successProvider(): array
    {
        return [
            [
                static function (): void
                {
                },
            ],
            ['PHPUnit\Framework\assertIsCallable

Method(Assert::class, 'assertIsCallable')]
#[TestDox('assertIsCallable()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsCallableTest extends TestCase
{
    /**
     * @return non-empty-list


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

use function fclose;
use function fopen;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDo

Case
{
    /**
     * @return non-empty-list<array{0: mixed}>
     */
    public static function failureProvider(): array
    {
        $openResource = fopen(__FILE__, 'r');

        return [
            [[]],
            [true],
            [0.0],

x;
use stdClass;

#[CoversMethod(Assert::class, 'assertIsClosedResource')]
#[TestDox('assertIsClosedResource()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsClosedResourceTest extends Test


t<array{0: mixed, 1: mixed}>
     */
    public static function successProvider(): array
    {
        return [
            [[3, 2, 1], [2, 3, 1]],
        ];
    }

    /**
     * @return non-empty-list<array{0: mixed, 1: mixed}>
     */
    public static

EqualsCanonicalizing')]
#[TestDox('assertEqualsCanonicalizing()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertEqualsCanonicalizingTest extends TestCase
{
    /**
     * @return non-empty-lis


HPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\TestFixture\Author;
use PHPUnit\TestFixture\Book;
use PHPUnit\TestFixture\ClassWithToString;
use PHPUnit\TestFixture\SampleClass;
use PHPUnit\TestFixture\Struct;
use PHPUnit\Util\Xml\Loader as XmlLoader;
use SplObjectStorage;
use stdClass;

#[CoversMethod(Assert::class, 'assertEquals')]
#

c function successProvider(): array
    {
        return array_merge(self::equalValues(), assertSameTest::sameValues());
    }

    /**
     * @return non-empty-list<array{0: mixed, 1: mixed}>
     */
    public static function failureProvider(): array

[TestDox('assertEquals()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertEqualsTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: mixed, 1: mixed}>
     */
    public stati


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFalse')]
#[TestDox('assertFalse()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class ass

testSucceedsWhenConstraintEvaluatesToTrue(): void
    {
        $this->assertFalse(false);
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void
    {
        $this->expectException(AssertionFailedError::class);

        $this->assertF

ertFalseTest extends TestCase
{
    public function


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFileEqualsCanonicalizing')]

tesToTrue(): void
    {
        $this->assertFileNotEquals(TEST_FILES_PATH . 'foo.txt', TEST_FILES_PATH . 'bar.txt');
        $this->assertFileEqualsCanonicalizing(TEST_FILES_PATH . 'foo.txt', TEST_FILES_PATH . 'foo.txt');
    }

    public function testFa

#[TestDox('assertFileEqualsCanonicalizing()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertFileEqualsCanonicalizingTest extends TestCase
{
    public function testSucceedsWhenConstraintEvalua


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFileEqualsIgnoringCase')]
#[

rue(): void
    {
        $this->assertFileEqualsIgnoringCase(
            TEST_FILES_PATH . 'foo.xml',
            TEST_FILES_PATH . 'fooUppercase.xml',
        );
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void
    {
        $t

TestDox('assertFileEqualsIgnoringCase()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertFileEqualsIgnoringCaseTest extends TestCase
{
    public function testSucceedsWhenConstraintEvaluatesToT


     */
    public static function successProvider(): array
    {
        return [
            [__FILE__],
        ];
    }

    /**
     * @return non-empty-list<array{0: non-empty-string}>
     */
    public static function failureProvider(): array
    {

FileExists')]
#[TestDox('assertFileExists()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertFileExistsTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: non-empty-string}>


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

use const PHP_OS_FAMILY;
use function chmod;
use function octdec;
use function sys_get_temp_dir;
use function tempnam;
use function unlink;
use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attri

 assertFileIsNotWritableTest extends TestCase
{
    private string $file;

    protected function setUp(): void
    {
        $this->file = tempnam(sys_get_temp_dir(), __CLASS__);
    }

    protected function tearDown(): void
    {
        @unlink($this->

butes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFileIsNotWritable')]
#[TestDox('assertFileIsNotWritable()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class


tFileIsWritableTest extends TestCase
{
    private string $file;

    protected function setUp(): void
    {
        $this->file = tempnam(sys_get_temp_dir(), __CLASS__);
    }

    protected function tearDown(): void
    {
        @unlink($this->file);

butes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFileIsWritable')]
#[TestDox('assertFileIsWritable()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class asser


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFileNotEqualsFileIgnoringWhitespac

FileIgnoringWhitespaceTest extends TestCase
{
    public function testSucceedsWhenConstraintEvaluatesToTrue(): void
    {
        $this->assertFileNotEqualsFileIgnoringWhitespace(
            TEST_FILES_PATH . 'string_with_spaces.txt',
            TEST_FIL

e')]
#[CoversMethod(Assert::class, 'stringEqualsStringIgnoringWhitespace')]
#[TestDox('assertFileNotEqualsFileIgnoringWhitespace()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertFileNotEquals


, 1: int}>
     */
    public static function failureProvider(): array
    {
        return [
            [2, 1],
            [2, 2],
        ];
    }

    public function testSucceedsWhenConstraintEvaluatesToTrue(): void
    {
        $this->assertGreater

lass, 'assertGreaterThan')]
#[TestDox('assertGreaterThan()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertGreaterThanTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: int


rn non-empty-list<array{0: mixed}>
     */
    public static function failureProvider(): array
    {
        $openResource = fopen(__FILE__, 'r');

        $closedResource = fopen(__FILE__, 'r');
        fclose($closedResource);

        return [

x;
use stdClass;

#[CoversMethod(Assert::class, 'assertIsArray')]
#[TestDox('assertIsArray()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsArrayTest extends TestCase
{
    /**
     * @retu


x;
use stdClass;

#[CoversMethod(Assert::class, 'assertIsFloat')]
#[TestDox('assertIsFloat()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertIsFloatTest extends TestCase
{
    /**
     * @retu


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assert

d, 1: mixed, 2: float}>
     */
    public static function successProvider(): array
    {
        return [
            [2.3, 2.5, 0.5],
            [[2.3], [2.5], 0.5],
        ];
    }

    /**
     * @return non-empty-list<array{0: mixed, 1: mixed, 2: fl

EqualsWithDelta')]
#[TestDox('assertEqualsWithDelta()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertEqualsWithDeltaTest extends TestCase
{
    /**
     * @return non-empty-list<array{0: mixe


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFileEqualsFileIgnoringWhitespace')

ingWhitespaceTest extends TestCase
{
    public function testSucceedsWhenConstraintEvaluatesToTrue(): void
    {
        $this->assertFileEqualsFileIgnoringWhitespace(
            TEST_FILES_PATH . 'string_with_spaces.txt',
            TEST_FILES_PATH . 's

]
#[CoversMethod(Assert::class, 'stringEqualsStringIgnoringWhitespace')]
#[TestDox('assertFileEqualsFileIgnoringWhitespace()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertFileEqualsFileIgnor


 assertFileIsNotReadableTest extends TestCase
{
    private string $file;

    protected function setUp(): void
    {
        $this->file = tempnam(sys_get_temp_dir(), __CLASS__);
    }

    protected function tearDown(): void
    {
        @unlink($this->

butes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFileIsNotReadable')]
#[TestDox('assertFileIsNotReadable()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFileMatchesFormat')]
#[Te

    {
        $this->assertFileMatchesFormat("FOO\n", TEST_FILES_PATH . 'expectedFileFormat.txt');
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void
    {
        $this->expectException(AssertionFailedError::class);

        $this-

stDox('assertFileMatchesFormat()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertFileMatchesFormatTest extends TestCase
{
    public function testSucceedsWhenConstraintEvaluatesToTrue(): void


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

use PHPUnit\Framework\Attributes\CoversMethod;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\TestDox;

#[CoversMethod(Assert::class, 'assertFileNotEquals')]
#[TestDox('

this->assertFileNotEquals(
            TEST_FILES_PATH . 'foo.xml',
            TEST_FILES_PATH . 'bar.xml',
        );
    }

    public function testFailsWhenConstraintEvaluatesToFalse(): void
    {
        $this->expectException(AssertionFailedError::cl

assertFileNotEquals()')]
#[Small]
#[Group('framework')]
#[Group('framework/assertions')]
final class assertFileNotEqualsTest extends TestCase
{
    public function testSucceedsWhenConstraintEvaluatesToTrue(): void
    {
        $