prefix
stringlengths
512
512
suffix
stringlengths
256
256
middle
stringlengths
14
229
meta
dict
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 Countable; use PHPUnit\Framework\Attributes\CoversMethod; ...
eTest::class, 'failureProvider')] public function testSucceedsWhenConstraintEvaluatesToTrue(Countable|iterable $expected, Countable|iterable $actual): void { $this->assertNotSameSize($expected, $actual); } #[DataProviderExternal(as
(Assert::class, 'assertNotSameSize')] #[TestDox('assertNotSameSize()')] #[Small] #[Group('framework')] #[Group('framework/assertions')] final class assertNotSameSizeTest extends TestCase { #[DataProviderExternal(assertSameSiz
{ "filepath": "tests/unit/Framework/Assert/assertNotSameSizeTest.php", "language": "php", "file_size": 1645, "cut_index": 537, "middle_length": 229 }
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; us...
{ $this->assertXmlFileEqualsXmlFile( TEST_FILES_PATH . 'foo.xml', TEST_FILES_PATH . 'foo.xml', ); } public function testFailsWhenConstraintEvaluatesToFalse(): void { $this->expectException(As
'assertXmlFileEqualsXmlFile()')] #[Small] #[Group('framework')] #[Group('framework/assertions')] final class assertXmlFileEqualsXmlFileTest extends TestCase { public function testSucceedsWhenConstraintEvaluatesToTrue(): void
{ "filepath": "tests/unit/Framework/Assert/assertXmlFileEqualsXmlFileTest.php", "language": "php", "file_size": 1410, "cut_index": 524, "middle_length": 229 }
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; us...
lic function testSucceedsWhenConstraintEvaluatesToTrue(): void { $this->assertXmlStringEqualsXmlFileConsideringComments( TEST_FILES_PATH . 'xml-with-comments.xml', '<root><!-- a comment --><node/></root>', );
omments')] #[TestDox('assertXmlStringEqualsXmlFileConsideringComments()')] #[Small] #[Group('framework')] #[Group('framework/assertions')] final class assertXmlStringEqualsXmlFileConsideringCommentsTest extends TestCase { pub
{ "filepath": "tests/unit/Framework/Assert/assertXmlStringEqualsXmlFileConsideringCommentsTest.php", "language": "php", "file_size": 1323, "cut_index": 524, "middle_length": 229 }
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; us...
{ public function testSucceedsWhenConstraintEvaluatesToTrue(): void { $this->assertXmlStringNotEqualsXmlFileConsideringComments( TEST_FILES_PATH . 'xml-with-comments.xml', '<root><node/></root>', ); }
ngComments')] #[TestDox('assertXmlStringNotEqualsXmlFileConsideringComments()')] #[Small] #[Group('framework')] #[Group('framework/assertions')] final class assertXmlStringNotEqualsXmlFileConsideringCommentsTest extends TestCase
{ "filepath": "tests/unit/Framework/Assert/assertXmlStringNotEqualsXmlFileConsideringCommentsTest.php", "language": "php", "file_size": 1338, "cut_index": 524, "middle_length": 229 }
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\Fra...
lStringConsideringCommentsTest extends TestCase { #[DataProviderExternal(assertXmlStringEqualsXmlStringConsideringCommentsTest::class, 'failureProvider')] public function testSucceedsWhenConstraintEvaluatesToTrue(string $expectedXml, string $actual
'assertXmlStringNotEqualsXmlStringConsideringComments')] #[TestDox('assertXmlStringNotEqualsXmlStringConsideringComments()')] #[Small] #[Group('framework')] #[Group('framework/assertions')] final class assertXmlStringNotEqualsXm
{ "filepath": "tests/unit/Framework/Assert/assertXmlStringNotEqualsXmlStringConsideringCommentsTest.php", "language": "php", "file_size": 1527, "cut_index": 537, "middle_length": 229 }
<?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Framework; use PHPUnit\Framework\Attributes\Cove...
id { $this->assertStringEndsNotWith('suffix', 'foo'); } public function testFailsWhenConstraintEvaluatesToFalse(): void { $this->expectException(AssertionFailedError::class); $this->assertStringEndsNotWith('suffix'
[TestDox('assertStringEndsNotWith()')] #[Small] #[Group('framework')] #[Group('framework/assertions')] final class assertStringEndsNotWithTest extends TestCase { public function testSucceedsWhenConstraintEvaluatesToTrue(): vo
{ "filepath": "tests/unit/Framework/Assert/assertStringEndsNotWithTest.php", "language": "php", "file_size": 1021, "cut_index": 512, "middle_length": 229 }
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\Fra...
stanceOfTest::class, 'failureProvider')] public function testSucceedsWhenConstraintEvaluatesToTrue(string $expected, mixed $actual): void { $this->assertNotInstanceOf($expected, $actual); } #[DataProviderExternal(assertInstanceOfTe
Assert::class, 'assertNotInstanceOf')] #[TestDox('assertNotInstanceOf()')] #[Small] #[Group('framework')] #[Group('framework/assertions')] final class assertNotInstanceOfTest extends TestCase { #[DataProviderExternal(assertIn
{ "filepath": "tests/unit/Framework/Assert/assertNotInstanceOfTest.php", "language": "php", "file_size": 1593, "cut_index": 537, "middle_length": 229 }
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\Fra...
{ $this->assertXmlFileNotEqualsXmlFile( TEST_FILES_PATH . 'foo.xml', TEST_FILES_PATH . 'bar.xml', ); } public function testFailsWhenConstraintEvaluatesToFalse(): void { $this->expectException(Ass
FileNotEqualsXmlFile()')] #[Small] #[Group('framework')] #[Group('framework/assertions')] final class assertXmlFileNotEqualsXmlFileTest extends TestCase { public function testSucceedsWhenConstraintEvaluatesToTrue(): void
{ "filepath": "tests/unit/Framework/Assert/assertXmlFileNotEqualsXmlFileTest.php", "language": "php", "file_size": 1520, "cut_index": 537, "middle_length": 229 }
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 ...
public function testMarksTestAsIncomplete(): void { $message = 'message'; $this->expectException(IncompleteTestError::class); $this->expectExceptionMessageIs($message); $this->markTestIncomplete($message); } }
inal class markTestIncompleteTest extends TestCase {
{ "filepath": "tests/unit/Framework/Assert/markTestIncompleteTest.php", "language": "php", "file_size": 915, "cut_index": 606, "middle_length": 52 }
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\CoversMeth...
uatesToTrue(): void { $object = new stdClass; $this->assertObjectNotHasProperty('theProperty', $object); } public function testFailsWhenConstraintEvaluatesToFalse(): void { $object = new stdClass;
operty')] #[TestDox('assertObjectNotHasProperty()')] #[Small] #[Group('framework')] #[Group('framework/assertions')] final class assertObjectNotHasPropertyTest extends TestCase { public function testSucceedsWhenConstraintEval
{ "filepath": "tests/unit/Framework/Assert/assertObjectNotHasPropertyTest.php", "language": "php", "file_size": 1177, "cut_index": 518, "middle_length": 229 }
* 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\Att...
final class markTestSkippedTest extends TestCase { public function testMarksTestAsSkipped(): void { $message = 'message'; $this->expectException(SkippedWithMessageException::class); $this->expectExceptionMessageIs($message)
roup('framework')] #[Group('framework/assertions')]
{ "filepath": "tests/unit/Framework/Assert/markTestSkippedTest.php", "language": "php", "file_size": 908, "cut_index": 547, "middle_length": 52 }
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\Fra...
on-empty-list<array{0: non-empty-string, 1: non-empty-string}> */ public static function successProvider(): array { return [ ['<root/>', '<root/>'], ['<root/>', '<root></root>'], ['<root><!-- comment
XmlStringEqualsXmlString')] #[TestDox('assertXmlStringEqualsXmlString()')] #[Small] #[Group('framework')] #[Group('framework/assertions')] final class assertXmlStringEqualsXmlStringTest extends TestCase { /** * @return n
{ "filepath": "tests/unit/Framework/Assert/assertXmlStringEqualsXmlStringTest.php", "language": "php", "file_size": 2019, "cut_index": 537, "middle_length": 229 }
that was distributed with this source code. */ namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; use PHPUnit\Framework\ExpectationFailedException; use PHP...
return [ 'empty arrays, keys and order matter' => [ true, '', [], [], true, true, ], 'identical arrays, keys and order
ArraysAreIdenticalTest extends TestCase { /** * @return array<string, array{bool, string, array<mixed>, mixed, bool, bool}> */ public static function provider(): array { $object = new stdClass;
{ "filepath": "tests/unit/Framework/Constraint/Array/ArraysAreIdenticalTest.php", "language": "php", "file_size": 8860, "cut_index": 716, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Gr...
ray{bool, string, NativeType, mixed}> */ public static function nativeTypeProvider(): array { return [ [ true, '', NativeType::Int, [0, 1, 2], ],
aversableContainsOnly::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class TraversableContainsOnlyTest extends TestCase { /** * @return non-empty-list<ar
{ "filepath": "tests/unit/Framework/Constraint/Traversable/TraversableContainsOnlyTest.php", "language": "php", "file_size": 4723, "cut_index": 614, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attribute...
(false, returnResult: true)); $this->assertFalse((new IsFalse)->evaluate(true, returnResult: true)); } public function testCanBeRepresentedAsString(): void { $this->assertSame('is false', (new IsFalse)->toString()); }
onstraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class IsFalseTest extends TestCase { public function testCanBeEvaluated(): void { $this->assertTrue((new IsFalse)->evaluate
{ "filepath": "tests/unit/Framework/Constraint/Boolean/IsFalseTest.php", "language": "php", "file_size": 2563, "cut_index": 563, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attribute...
ue, returnResult: true)); $this->assertFalse((new IsTrue)->evaluate(false, returnResult: true)); } public function testCanBeRepresentedAsString(): void { $this->assertSame('is true', (new IsTrue)->toString()); } public
nstraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class IsTrueTest extends TestCase { public function testCanBeEvaluated(): void { $this->assertTrue((new IsTrue)->evaluate(tr
{ "filepath": "tests/unit/Framework/Constraint/Boolean/IsTrueTest.php", "language": "php", "file_size": 2545, "cut_index": 563, "middle_length": 229 }
<?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\Attr...
e, returnResult: true)); } public function testCanBeRepresentedAsString(): void { $this->assertSame('is anything', (new IsAnything)->toString()); } public function testIsCountable(): void { $this->assertCount(0, (n
:class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class IsAnythingTest extends TestCase { public function testCanBeEvaluated(): void { $this->assertTrue((new IsAnything)->evaluate(tru
{ "filepath": "tests/unit/Framework/Constraint/IsAnythingTest.php", "language": "php", "file_size": 1022, "cut_index": 512, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attribute...
ing, string}> */ public static function provider(): array { return [ [ true, '', __DIR__, ], [ false, 'Failed assertin
(DirectoryExists::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class DirectoryExistsTest extends TestCase { /** * @return non-empty-list<array{bool, str
{ "filepath": "tests/unit/Framework/Constraint/Filesystem/DirectoryExistsTest.php", "language": "php", "file_size": 2861, "cut_index": 563, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attribute...
g}> */ public static function provider(): array { return [ [ true, '', __FILE__, ], [ false, 'Failed asserting that fi
(FileExists::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class FileExistsTest extends TestCase { /** * @return non-empty-list<array{bool, string, strin
{ "filepath": "tests/unit/Framework/Constraint/Filesystem/FileExistsTest.php", "language": "php", "file_size": 2794, "cut_index": 563, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attribute...
g}> */ public static function provider(): array { return [ [ true, '', __FILE__, ], [ false, 'Failed asserting that "/
(IsReadable::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class IsReadableTest extends TestCase { /** * @return non-empty-list<array{bool, string, strin
{ "filepath": "tests/unit/Framework/Constraint/Filesystem/IsReadableTest.php", "language": "php", "file_size": 2788, "cut_index": 563, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attribute...
g}> */ public static function provider(): array { return [ [ true, '', __FILE__, ], [ false, 'Failed asserting that "/
(IsWritable::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class IsWritableTest extends TestCase { /** * @return non-empty-list<array{bool, string, strin
{ "filepath": "tests/unit/Framework/Constraint/Filesystem/IsWritableTest.php", "language": "php", "file_size": 2788, "cut_index": 563, "middle_length": 229 }
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\Constraint; use Exception; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framewor...
nal class IsInstanceOfTest extends TestCase { /** * @return non-empty-list<array{bool, string, string, mixed}> */ public static function provider(): array { return [ [ true, '',
tion; use stdClass; use Throwable; #[CoversClass(IsInstanceOf::class)] #[CoversClass(Constraint::class)] #[CoversClass(UnknownClassOrInterfaceException::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] fi
{ "filepath": "tests/unit/Framework/Constraint/Type/IsInstanceOfTest.php", "language": "php", "file_size": 3737, "cut_index": 614, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attribute...
ssertTrue($constraint->evaluate(null, returnResult: true)); $this->assertFalse($constraint->evaluate(false, returnResult: true)); } public function testCanBeRepresentedAsString(): void { $this->assertSame('is null', (new IsNull
nstraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class IsNullTest extends TestCase { public function testCanBeEvaluated(): void { $constraint = new IsNull; $this->a
{ "filepath": "tests/unit/Framework/Constraint/Type/IsNullTest.php", "language": "php", "file_size": 2576, "cut_index": 563, "middle_length": 229 }
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\Constraint; use function fclose; use function fopen; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProv...
list<array{bool, string, NativeType, mixed}> */ public static function provider(): array { return [ [ true, '', NativeType::Numeric, 0, ],
TestCase; use stdClass; #[CoversClass(IsType::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class IsTypeTest extends TestCase { /** * @return non-empty-
{ "filepath": "tests/unit/Framework/Constraint/Type/IsTypeTest.php", "language": "php", "file_size": 4322, "cut_index": 614, "middle_length": 229 }
that was distributed with this source code. */ namespace PHPUnit\Framework\Constraint; use const PHP_EOL; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; use PHPUnit\Framework\ExpectationFaile...
n [ [ true, <<<'EOT' is equal to Array &%d [ 0 => 'value', ] EOT, '', '', ['value'], ['value'], ], [ tr
traints')] final class IsEqualCanonicalizingTest extends TestCase { /** * @return non-empty-list<array{bool, string, string, string, mixed, mixed}> */ public static function provider(): array { retur
{ "filepath": "tests/unit/Framework/Constraint/Equality/IsEqualCanonicalizingTest.php", "language": "php", "file_size": 8573, "cut_index": 716, "middle_length": 229 }
that was distributed with this source code. */ namespace PHPUnit\Framework\Constraint; use const PHP_EOL; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; use PHPUnit\Framework\ExpectationFaile...
[ true, <<<'EOT' is equal to Array &%d [ 0 => 'value', ] EOT, '', '', ['value'], ['VALUE'], ], [ true,
aints')] final class IsEqualIgnoringCaseTest extends TestCase { /** * @return non-empty-list<array{bool, string, string, string, mixed, mixed}> */ public static function provider(): array { return [
{ "filepath": "tests/unit/Framework/Constraint/Equality/IsEqualIgnoringCaseTest.php", "language": "php", "file_size": 8106, "cut_index": 716, "middle_length": 229 }
PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\TestCase; use PHPUnit\TestFixture\EnumerationEquals\Example; use PHPUnit\TestFixture\EnumerationEquals\ExampleInt; use PHPUnit\TestFixture\EnumerationEquals\ExampleString;...
al to Array &%d [ 0 => 'value', ] EOT, '', '', ['value'], ['value'], ], [ true, <<<'EOT' is equal to stdClass Object #%d ( 'foo
/** * @return non-empty-list<array{bool, string, string, string, mixed, mixed}> */ public static function provider(): array { return [ [ true, <<<'EOT' is equ
{ "filepath": "tests/unit/Framework/Constraint/Equality/IsEqualTest.php", "language": "php", "file_size": 11944, "cut_index": 921, "middle_length": 229 }
that was distributed with this source code. */ namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; use PHPUnit\Framework\ExpectationFailedException; use PHP...
true, 'is equal to 1.0 with delta <0.000000>', '', '', 1.0, 0.0, 1.0, ], [ true, 'is equal
sEqualWithDeltaTest extends TestCase { /** * @return non-empty-list<array{bool, string, string, string, mixed, float, mixed}> */ public static function provider(): array { return [ [
{ "filepath": "tests/unit/Framework/Constraint/Equality/IsEqualWithDeltaTest.php", "language": "php", "file_size": 5991, "cut_index": 716, "middle_length": 229 }
that was distributed with this source code. */ namespace PHPUnit\Framework\Constraint; use ArrayIterator; use ArrayObject; use EmptyIterator; use Generator; use IteratorAggregate; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use ...
atorAggregate2; use Traversable; #[CoversClass(Count::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class CountTest extends TestCase { /** * @return non-empty-list<array{bool, str
rk\TestCase; use PHPUnit\TestFixture\ExceptionThrowingIteratorAggregate; use PHPUnit\TestFixture\TestIterator; use PHPUnit\TestFixture\TestIterator2; use PHPUnit\TestFixture\TestIteratorAggregate; use PHPUnit\TestFixture\TestIter
{ "filepath": "tests/unit/Framework/Constraint/Cardinality/CountTest.php", "language": "php", "file_size": 7250, "cut_index": 716, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attribute...
ed, mixed}> */ public static function provider(): array { return [ [ true, '', 0, 1, ], [ false, 'Fail
(GreaterThan::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class GreaterThanTest extends TestCase { /** * @return non-empty-list<array{bool, string, mix
{ "filepath": "tests/unit/Framework/Constraint/Cardinality/GreaterThanTest.php", "language": "php", "file_size": 2573, "cut_index": 563, "middle_length": 229 }
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\Constraint; use ArrayIterator; use ArrayObject; use EmptyIterator; use PHPUnit\Framework\...
@return non-empty-list<array{bool, string, mixed}> */ public static function provider(): array { return [ [ true, '', [], ], [ true,
ception; use PHPUnit\Framework\TestCase; #[CoversClass(IsEmpty::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class IsEmptyTest extends TestCase { /** *
{ "filepath": "tests/unit/Framework/Constraint/Cardinality/IsEmptyTest.php", "language": "php", "file_size": 2811, "cut_index": 563, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attribute...
xed}> */ public static function provider(): array { return [ [ true, '', 1, 0, ], [ false, 'Failed ass
(LessThan::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class LessThanTest extends TestCase { /** * @return non-empty-list<array{bool, string, mixed, mi
{ "filepath": "tests/unit/Framework/Constraint/Cardinality/LessThanTest.php", "language": "php", "file_size": 2539, "cut_index": 563, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\Cover...
ng(): void { $this->assertSame('count matches 0', new SameSize([])->toString()); } public function testCanBeNegated(): void { $constraint = new LogicalNot(new SameSize([1])); $this->assertSame('count does not match
e::class)] #[CoversClass(Count::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class SameSizeTest extends TestCase { public function testCanBeRepresentedAsStri
{ "filepath": "tests/unit/Framework/Constraint/Cardinality/SameSizeTest.php", "language": "php", "file_size": 1373, "cut_index": 524, "middle_length": 229 }
bjectTest extends TestDoubleTestCase { public function testExpectationThatMethodIsNeverCalledSucceedsWhenMethodIsNotCalled(): void { $double = $this->createMock(AnInterface::class); $double->expects($this->never())->method('doSomething'); } public function testExpectationThatMethodIsNe...
rmAssertions] #[IgnorePhpunitDeprecations] public function testExpectationThatMethodIsCalledZeroOrMoreTimesSucceedsWhenMethodIsNotCalled(): void { $double = $this->createMock(AnInterface::class); $double->expects($this->any())-
ThatMockObjectExpectationFails( AnInterface::class . '::doSomething(): bool was not expected to be called, actually called 1 time.', $double, 'doSomething', ); } #[DoesNotPerfo
{ "filepath": "tests/unit/Framework/MockObject/MockObjectTest.php", "language": "php", "file_size": 40531, "cut_index": 2151, "middle_length": 229 }
that was distributed with this source code. */ namespace PHPUnit\Framework\MockObject; use function sprintf; use Generator; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; use PHPUnit\Framewor...
xture\MockObject\InterfaceWithMethodThatReturnsStatic; use PHPUnit\TestFixture\MockObject\YetAnotherInterface; use stdClass; #[CoversClass(ReturnValueGenerator::class)] #[Group('test-doubles')] #[Group('test-doubles/test-stub')] #[Small] final class Retur
ject\AnotherInterface; use PHPUnit\TestFixture\MockObject\AnotherInterfaceForIssue5593; use PHPUnit\TestFixture\MockObject\ExtendableClass; use PHPUnit\TestFixture\MockObject\InterfaceWithMethodThatReturnsSelf; use PHPUnit\TestFi
{ "filepath": "tests/unit/Framework/MockObject/ReturnValueGeneratorTest.php", "language": "php", "file_size": 8807, "cut_index": 716, "middle_length": 229 }
ork\ExpectationFailedException; use PHPUnit\Framework\MockObject\Generator\MethodNamedMethodException; use PHPUnit\Framework\MockObject\Runtime\PropertyHook; use PHPUnit\Framework\TestCase; use PHPUnit\TestFixture\MockObject\ExtendableClassCallingMethodInDestructor; use PHPUnit\TestFixture\MockObject\ExtendableClassWit...
t\InterfaceWithMethodThatHasDefaultParameterValues; use PHPUnit\TestFixture\MockObject\InterfaceWithNeverReturningMethod; use PHPUnit\TestFixture\MockObject\InterfaceWithPropertyWithGetHook; use PHPUnit\TestFixture\MockObject\InterfaceWithReturnTypeDeclara
Object\ExtendableClassWithVirtualPropertyWithGetHook; use PHPUnit\TestFixture\MockObject\ExtendableReadonlyClassWithCloneMethod; use PHPUnit\TestFixture\MockObject\InterfaceWithMethodNamedMethod; use PHPUnit\TestFixture\MockObjec
{ "filepath": "tests/unit/Framework/MockObject/TestDoubleTestCase.php", "language": "php", "file_size": 16167, "cut_index": 921, "middle_length": 229 }
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\MockObject\Generator; use Iterator; use PHPUnit\Framework\Attributes\CoversClass; use PHP...
[CoversClass(Generator::class)] #[Group('test-doubles')] #[Small] final class GeneratorTest extends TestCase { public function testReplacesTraversableWithIterator(): void { $double = (new Generator)->testDouble(Traversable::class, false);
ss; use PHPUnit\TestFixture\MockObject\ExtendableClassWithConstructorArguments; use PHPUnit\TestFixture\MockObject\InterfaceExtendingThrowable; use PHPUnit\TestFixture\MockObject\InterfaceExtendingTraversable; use Traversable; #
{ "filepath": "tests/unit/Framework/MockObject/Generator/GeneratorTest.php", "language": "php", "file_size": 2696, "cut_index": 563, "middle_length": 229 }
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\MockObject\Generator; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework...
alse, Type::fromName('string', false)); $this->assertSame($name, $property->name()); } public function testHasType(): void { $type = Type::fromName('string', false); $property = new HookedProperty('property-name', $ty
all] final class HookedPropertyTest extends TestCase { public function testHasName(): void { $name = 'property-name'; $property = new HookedProperty($name, Type::fromName('string', false), false, false, f
{ "filepath": "tests/unit/Framework/MockObject/Generator/HookedPropertyTest.php", "language": "php", "file_size": 2800, "cut_index": 563, "middle_length": 229 }
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\MockObject; use PHPUnit\Framework\Attributes...
atesMockObjectForInterfaceOrExtendableClassWithReturnValueConfigurationForMultipleMethods(): void { $double = $this->createConfiguredMock( InterfaceWithReturnTypeDeclaration::class, [ 'doSomething' =>
; #[Group('test-doubles')] #[Group('test-doubles/creation')] #[Group('test-doubles/mock-object')] #[Medium] #[TestDox('createConfiguredMock()')] final class CreateConfiguredMockTest extends TestCase { public function testCre
{ "filepath": "tests/unit/Framework/MockObject/Creation/CreateConfiguredMockTest.php", "language": "php", "file_size": 1195, "cut_index": 518, "middle_length": 229 }
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\MockObject; use PHPUnit\Framework\Attributes...
esTestStubForInterfaceOrExtendableClassWithReturnValueConfigurationForMultipleMethods(): void { $double = $this->createConfiguredStub( InterfaceWithReturnTypeDeclaration::class, [ 'doSomething' => tru
; #[Group('test-doubles')] #[Group('test-doubles/creation')] #[Group('test-doubles/test-stub')] #[Medium] #[TestDox('createConfiguredStub()')] final class CreateConfiguredStubTest extends TestCase { public function testCreat
{ "filepath": "tests/unit/Framework/MockObject/Creation/CreateConfiguredStubTest.php", "language": "php", "file_size": 1191, "cut_index": 518, "middle_length": 229 }
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\MockObject; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Medi...
st-doubles')] #[Group('test-doubles/creation')] #[Group('test-doubles/mock-object')] #[Medium] #[TestDox('createMockForIntersectionOfInterfaces()')] final class CreateMockForIntersectionOfInterfacesTest extends TestCase { public function testCreatesMoc
aceException; use PHPUnit\Framework\TestCase; use PHPUnit\TestFixture\MockObject\AnInterface; use PHPUnit\TestFixture\MockObject\AnotherInterface; use PHPUnit\TestFixture\MockObject\AnotherInterfaceThatDoesSomething; #[Group('te
{ "filepath": "tests/unit/Framework/MockObject/Creation/CreateMockForIntersectionOfInterfacesTest.php", "language": "php", "file_size": 2943, "cut_index": 563, "middle_length": 229 }
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\MockObject; use PHPUnit\Framework\Attributes\Disab...
ckForIntersectionOfInterfaces()')] #[DisableReturnValueGenerationForTestDoubles] final class CreateMockForIntersectionOfInterfacesWithDisabledReturnValueGenerationTest extends TestCase { public function testReturnValueGenerationCanBeDisabledWithAttribu
; use PHPUnit\TestFixture\MockObject\AnInterface; use PHPUnit\TestFixture\MockObject\AnotherInterface; #[Group('test-doubles')] #[Group('test-doubles/creation')] #[Group('test-doubles/mock-object')] #[Medium] #[TestDox('createMo
{ "filepath": "tests/unit/Framework/MockObject/Creation/CreateMockForIntersectionOfInterfacesWithDisabledReturnValueGenerationTest.php", "language": "php", "file_size": 1253, "cut_index": 524, "middle_length": 229 }
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\MockObject; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Medium; use PHPUnit\Framework\Attributes\TestDox; use P...
MockObject\Generator\UnknownTypeException; use PHPUnit\Framework\TestCase; use PHPUnit\TestFixture\MockObject\AnInterface; use PHPUnit\TestFixture\MockObject\Enumeration; use PHPUnit\TestFixture\MockObject\ExtendableClass; use PHPUnit\TestFixture\MockObjec
Exception; use PHPUnit\Framework\MockObject\Generator\Generator; use PHPUnit\Framework\MockObject\Generator\InvalidMethodNameException; use PHPUnit\Framework\MockObject\Generator\MethodNamedMethodException; use PHPUnit\Framework\
{ "filepath": "tests/unit/Framework/MockObject/Creation/CreateMockTest.php", "language": "php", "file_size": 4478, "cut_index": 614, "middle_length": 229 }
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\MockObject; use PHPUnit\Framework\Attribu...
tDoubles] final class CreateMockWithDisabledReturnValueGenerationTest extends TestCase { public function testReturnValueGenerationCanBeDisabledWithAttribute(): void { $double = $this->createMock(AnInterface::class); $this->expectEx
\TestCase; use PHPUnit\TestFixture\MockObject\AnInterface; #[Group('test-doubles')] #[Group('test-doubles/creation')] #[Group('test-doubles/mock-object')] #[Medium] #[TestDox('createMock()')] #[DisableReturnValueGenerationForTes
{ "filepath": "tests/unit/Framework/MockObject/Creation/CreateMockWithDisabledReturnValueGenerationTest.php", "language": "php", "file_size": 1092, "cut_index": 515, "middle_length": 229 }
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\MockObject; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Medi...
public function testCreatesPartialMockObjectForExtendableClass(): void { $double = $this->createPartialMock(ExtendableClass::class, ['doSomethingElse']); $double->expects($this->once())->method('doSomethingElse')->willReturn(true);
Class; use ReflectionProperty; #[Group('test-doubles')] #[Group('test-doubles/creation')] #[Group('test-doubles/mock-object')] #[Medium] #[TestDox('createPartialMock()')] final class CreatePartialMockTest extends TestCase {
{ "filepath": "tests/unit/Framework/MockObject/Creation/CreatePartialMockTest.php", "language": "php", "file_size": 2787, "cut_index": 563, "middle_length": 229 }
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\MockObject; use PHPUnit\Framework\Attributes...
onForTestDoubles] final class CreatePartialMockWithDisabledReturnValueGenerationTest extends TestCase { public function testReturnValueGenerationCanBeDisabledWithAttribute(): void { $double = $this->createPartialMock(ExtendableClass::class,
stCase; use PHPUnit\TestFixture\MockObject\ExtendableClass; #[Group('test-doubles')] #[Group('test-doubles/creation')] #[Group('test-doubles/mock-object')] #[Medium] #[TestDox('createPartialMock()')] #[DisableReturnValueGenerati
{ "filepath": "tests/unit/Framework/MockObject/Creation/CreatePartialMockWithDisabledReturnValueGenerationTest.php", "language": "php", "file_size": 1138, "cut_index": 518, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; us...
$this->assertSame(42, $constraint(42)); } public function testInvokeThrowsWhenConstraintIsNotMet(): void { $constraint = new IsIdentical(42); $this->expectException(ExpectationFailedException::class); $const
l] #[Group('framework')] #[Group('framework/constraints')] final class ConstraintTest extends TestCase { public function testInvokeReturnsActualValueWhenConstraintIsMet(): void { $constraint = new IsIdentical(42);
{ "filepath": "tests/unit/Framework/Constraint/ConstraintTest.php", "language": "php", "file_size": 3160, "cut_index": 614, "middle_length": 229 }
that was distributed with this source code. */ namespace PHPUnit\Framework\Constraint; use function fclose; use function fopen; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; use PHPUnit\Fram...
[ 'is identical to 0', 'Failed asserting that 1 is identical to 0.', '', 0, 1, ], [ 'is identical to an object of class "st
amework/constraints')] final class IsIdenticalTest extends TestCase { /** * @return non-empty-list<array{string, string, string, mixed, mixed}> */ public static function provider(): array { return [
{ "filepath": "tests/unit/Framework/Constraint/IsIdenticalTest.php", "language": "php", "file_size": 7201, "cut_index": 716, "middle_length": 229 }
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\Constraint; use function json_encode; use function str_repeat; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attribute...
*/ public static function provider(): array { return [ [ true, '', json_encode(['key' => 'value']), ], [ false, 'Failed ass
(IsJson::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class IsJsonTest extends TestCase { /** * @return non-empty-list<array{bool, string, mixed}>
{ "filepath": "tests/unit/Framework/Constraint/String/IsJsonTest.php", "language": "php", "file_size": 3470, "cut_index": 614, "middle_length": 229 }
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\Constraint; use function str_repeat; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUni...
rn non-empty-list<array{bool, string, string, string}> */ public static function provider(): array { return [ [ true, '', '/.*/', 'string', ],
work\TestCase; #[CoversClass(RegularExpression::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class RegularExpressionTest extends TestCase { /** * @retu
{ "filepath": "tests/unit/Framework/Constraint/String/RegularExpressionTest.php", "language": "php", "file_size": 3390, "cut_index": 614, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Gr...
ring, string}> */ public static function provider(): array { return [ [ true, '', "string\r", "string\r\n", ], [ false
oversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class StringEqualsStringIgnoringLineEndingsTest extends TestCase { /** * @return non-empty-list<array{bool, string, st
{ "filepath": "tests/unit/Framework/Constraint/String/StringEqualsStringIgnoringLineEndingsTest.php", "language": "php", "file_size": 3180, "cut_index": 614, "middle_length": 229 }
scriptionTest extends TestCase { public function testConstraintStringMatchesDirectorySeparator(): void { $constraint = new StringMatchesFormatDescription('*%e*'); $this->assertFalse($constraint->evaluate('**', '', true)); $this->assertFalse($constraint->evaluate('*a*', '', true)); ...
, '', true)); $this->assertTrue($constraint->evaluate('*foo 123 bar*', '', true)); } public function testConstraintStringMatchesOptionalString(): void { $constraint = new StringMatchesFormatDescription('*%S*'); $this->
ringMatchesFormatDescription('*%s*'); $this->assertFalse($constraint->evaluate('**', '', true)); $this->assertFalse($constraint->evaluate("*\n*", '', true)); $this->assertTrue($constraint->evaluate('***'
{ "filepath": "tests/unit/Framework/Constraint/String/StringMatchesFormatDescriptionTest.php", "language": "php", "file_size": 18042, "cut_index": 1331, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Gr...
string, string}> */ public static function provider(): array { return [ [ true, '', 'prefix', 'prefix substring suffix', ], [
StartsWith::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class StringStartsWithTest extends TestCase { /** * @return non-empty-list<array{bool, string,
{ "filepath": "tests/unit/Framework/Constraint/String/StringStartsWithTest.php", "language": "php", "file_size": 3143, "cut_index": 614, "middle_length": 229 }
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\Constraint; use const NAN; use function acos; use function log; use PHPUnit\Framework\Att...
aint = new IsNan; $this->assertTrue($constraint->evaluate(acos(2), returnResult: true)); $this->assertFalse($constraint->evaluate(log(0), returnResult: true)); $this->assertFalse($constraint->evaluate(1, returnResult: true)); }
Class(IsNan::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class IsNanTest extends TestCase { public function testCanBeEvaluated(): void { $constr
{ "filepath": "tests/unit/Framework/Constraint/Math/IsNanTest.php", "language": "php", "file_size": 2376, "cut_index": 563, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; us...
ss; $objectWithProperty->theProperty = 'value'; $this->assertTrue($constraint->evaluate($objectWithProperty, returnResult: true)); $this->assertFalse($constraint->evaluate(new stdClass, returnResult: true)); $this->assertFa
aints')] final class ObjectHasPropertyTest extends TestCase { public function testCanBeEvaluated(): void { $constraint = new ObjectHasProperty('theProperty'); $objectWithProperty = new stdCla
{ "filepath": "tests/unit/Framework/Constraint/Object/ObjectHasPropertyTest.php", "language": "php", "file_size": 3300, "cut_index": 614, "middle_length": 229 }
that was distributed with this source code. */ namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; use PHPUnit\Framework\ExpectationFailedException; use PHP...
matter' => [ true, '', [], [], true, true, ], 'identical arrays, keys and order matter' => [ true, '',
t extends TestCase { /** * @return array<string, array{bool, string, array<mixed>, mixed, bool, bool}> */ public static function provider(): array { return [ 'empty arrays, keys and order
{ "filepath": "tests/unit/Framework/Constraint/Array/ArraysAreEqualTest.php", "language": "php", "file_size": 6788, "cut_index": 716, "middle_length": 229 }
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\Constraint; use function fclose; use function fopen; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProv...
*/ public static function provider(): array { return [ [ true, '', [0 => 'value', 1 => 'another-value'], ], [ false, 'F
lass(IsList::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class IsListTest extends TestCase { /** * @return non-empty-list<array{bool, string, mixed}>
{ "filepath": "tests/unit/Framework/Constraint/Array/IsListTest.php", "language": "php", "file_size": 3717, "cut_index": 614, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Gr...
c function provider(): array { return [ [ true, '', 'expected-message', 'expected-message', ], [ true, '',
nt::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class ExceptionMessageIsTest extends TestCase { /** * @return non-empty-list<array{bool, string, string, mixed}> */ public stati
{ "filepath": "tests/unit/Framework/Constraint/Exception/ExceptionMessageIsTest.php", "language": "php", "file_size": 3538, "cut_index": 614, "middle_length": 229 }
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\Constraint; use InvalidArgumentException; use PHPUnit\Framework\Attributes\CoversClass; u...
* @return non-empty-list<array{bool, string, string, mixed}> */ public static function provider(): array { return [ [ true, '', RuntimeException::class, new Ru
ework\TestCase; use RuntimeException; #[CoversClass(Exception::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class ExceptionTest extends TestCase { /**
{ "filepath": "tests/unit/Framework/Constraint/Exception/ExceptionTest.php", "language": "php", "file_size": 2450, "cut_index": 563, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Gr...
bool, string, string, LogicalAnd, mixed}> */ public static function provider(): array { return [ [ true, 'is of type bool and is true', '', self::logicalAnd(
class)] #[CoversClass(Operator::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class LogicalAndTest extends TestCase { /** * @return non-empty-list<array{
{ "filepath": "tests/unit/Framework/Constraint/Operator/LogicalAndTest.php", "language": "php", "file_size": 3928, "cut_index": 614, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Gr...
ol, string, string, LogicalOr, mixed}> */ public static function provider(): array { return [ [ true, 'is of type bool or is true', '', self::logicalOr(
lass)] #[CoversClass(Operator::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class LogicalOrTest extends TestCase { /** * @return non-empty-list<array{bo
{ "filepath": "tests/unit/Framework/Constraint/Operator/LogicalOrTest.php", "language": "php", "file_size": 3489, "cut_index": 614, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Gr...
/** * @return non-empty-list<array{bool, string, mixed, mixed}> */ public static function provider(): array { $o = new stdClass; $s = new SplObjectStorage; $s->offsetSet($o); return [ [
tainsIdentical::class)] #[CoversClass(TraversableContains::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class TraversableContainsIdenticalTest extends TestCase {
{ "filepath": "tests/unit/Framework/Constraint/Traversable/TraversableContainsIdenticalTest.php", "language": "php", "file_size": 4215, "cut_index": 614, "middle_length": 229 }
Attributes\Group; use PHPUnit\Framework\Attributes\Small; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\TestCase; #[CoversClass(StringContains::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class StringContainsTest extends Tes...
'Empty needles are supported with default options given' => [ true, '', false, false, '', 'prefix needle suffix', ], 'It fin
'It finds the needle with default options given' => [ true, '', false, false, 'needle', 'prefix needle suffix', ],
{ "filepath": "tests/unit/Framework/Constraint/String/StringContainsTest.php", "language": "php", "file_size": 10053, "cut_index": 921, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Gr...
ng, string}> */ public static function provider(): array { return [ [ true, '', 'hello world', "hello\tworld", ], [ tr
versClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class StringEqualsStringIgnoringWhitespaceTest extends TestCase { /** * @return non-empty-list<array{bool, string, stri
{ "filepath": "tests/unit/Framework/Constraint/String/StringEqualsStringIgnoringWhitespaceTest.php", "language": "php", "file_size": 3925, "cut_index": 614, "middle_length": 229 }
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\Constraint; use function acos; use function log; use PHPUnit\Framework\Attributes\CoversC...
w IsFinite; $this->assertTrue($constraint->evaluate(1, returnResult: true)); $this->assertFalse($constraint->evaluate(log(0), returnResult: true)); $this->assertFalse($constraint->evaluate(acos(2), returnResult: true)); }
:class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class IsFiniteTest extends TestCase { public function testCanBeEvaluated(): void { $constraint = ne
{ "filepath": "tests/unit/Framework/Constraint/Math/IsFiniteTest.php", "language": "php", "file_size": 2414, "cut_index": 563, "middle_length": 229 }
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\Constraint; use ArrayObject; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framew...
c static function provider(): array { return [ [ true, '', 0, [0 => 'value'], ], [ true, '', 'k
s(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class ArrayHasKeyTest extends TestCase { /** * @return non-empty-list<array{bool, string, int|string, mixed}> */ publi
{ "filepath": "tests/unit/Framework/Constraint/Array/ArrayHasKeyTest.php", "language": "php", "file_size": 3857, "cut_index": 614, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attribute...
empty-list<array{bool, string, string, mixed}> */ public static function provider(): array { return [ [ true, '', 'expected-message', 'expected-message',
(ExceptionMessageIsOrContains::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class ExceptionMessageIsOrContainsTest extends TestCase { /** * @return non-
{ "filepath": "tests/unit/Framework/Constraint/Exception/ExceptionMessageIsOrContainsTest.php", "language": "php", "file_size": 3043, "cut_index": 563, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attribute...
essionTest extends TestCase { /** * @return non-empty-list<array{bool, string, string, mixed}> */ public static function provider(): array { return [ [ true, '', '/[0
ramework\TestCase; #[CoversClass(ExceptionMessageMatchesRegularExpression::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class ExceptionMessageMatchesRegularExpr
{ "filepath": "tests/unit/Framework/Constraint/Exception/ExceptionMessageMatchesRegularExpressionTest.php", "language": "php", "file_size": 3036, "cut_index": 563, "middle_length": 229 }
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\Constraint; use DateInterval; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Frame...
TestCase { /** * @return non-empty-list<array{bool, string, mixed, mixed}> */ public static function provider(): array { $o = new stdClass; $s = new SplObjectStorage; $s->offsetSet($o); return [
ass(TraversableContainsEqual::class)] #[CoversClass(TraversableContains::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class TraversableContainsEqualTest extends
{ "filepath": "tests/unit/Framework/Constraint/Traversable/TraversableContainsEqualTest.php", "language": "php", "file_size": 4802, "cut_index": 614, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Gr...
ng, string}> */ public static function provider(): array { return [ [ true, '', 'suffix', 'prefix substring suffix', ], [
EndsWith::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class StringEndsWithTest extends TestCase { /** * @return non-empty-list<array{bool, string, stri
{ "filepath": "tests/unit/Framework/Constraint/String/StringEndsWithTest.php", "language": "php", "file_size": 3115, "cut_index": 614, "middle_length": 229 }
Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; use PHPUnit\Framework\ComparisonMethodDoesNotAcceptParameterTypeException; use PHPUnit\Framework\ComparisonMethodDoesNotDeclareBoolReturnTypeException; use PHPUnit\Framework\ComparisonMethodDoesNotDeclareExactlyOneParameterException; use PHPUnit\Framew...
ceptArguments; use PHPUnit\TestFixture\ObjectEquals\ValueObjectWithEqualsMethodThatDoesNotDeclareParameterType; use PHPUnit\TestFixture\ObjectEquals\ValueObjectWithEqualsMethodThatHasIncompatibleParameterType; use PHPUnit\TestFixture\ObjectEquals\ValueObje
estCase; use PHPUnit\TestFixture\ObjectEquals\ValueObject; use PHPUnit\TestFixture\ObjectEquals\ValueObjectWithEqualsMethodThatAcceptsTooManyArguments; use PHPUnit\TestFixture\ObjectEquals\ValueObjectWithEqualsMethodThatDoesNotAc
{ "filepath": "tests/unit/Framework/Constraint/Object/ObjectEqualsTest.php", "language": "php", "file_size": 9824, "cut_index": 921, "middle_length": 229 }
that was distributed with this source code. */ namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\Assert; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; use PHPUnit\Framework\Attri...
}> */ public static function provider(): array { return [ [ true, '', self::logicalNot(self::isTrue()), false, ], [ fa
:class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class LogicalNotTest extends TestCase { /** * @return non-empty-list<array{bool, string, LogicalNot, mixed
{ "filepath": "tests/unit/Framework/Constraint/Operator/LogicalNotTest.php", "language": "php", "file_size": 8661, "cut_index": 716, "middle_length": 229 }
er; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\TestCase; #[CoversClass(JsonMatches::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class JsonMat...
are unordered' => [ true, '', '', '{"second":"2", "first":1}', '{"first":1, "second":"2"}', ], 'object fields with numeric keys are unordered' => [
'valid JSON' => [ true, '', '', json_encode(['Mascott' => 'Tux']), json_encode(['Mascott' => 'Tux']), ], 'object fields
{ "filepath": "tests/unit/Framework/Constraint/JsonMatchesTest.php", "language": "php", "file_size": 11844, "cut_index": 921, "middle_length": 229 }
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\Constraint; use const INF; use function acos; use function log; use PHPUnit\Framework\Att...
$constraint = new IsInfinite; $this->assertTrue($constraint->evaluate(log(0), returnResult: true)); $this->assertFalse($constraint->evaluate(1, returnResult: true)); $this->assertFalse($constraint->evaluate(acos(2), returnResult
Class(IsInfinite::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class IsInfiniteTest extends TestCase { public function testCanBeEvaluated(): void {
{ "filepath": "tests/unit/Framework/Constraint/Math/IsInfiniteTest.php", "language": "php", "file_size": 2451, "cut_index": 563, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Gr...
bool, string, string, LogicalXor, mixed}> */ public static function provider(): array { return [ [ true, 'is false xor is true', '', self::logicalXor(
class)] #[CoversClass(Operator::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class LogicalXorTest extends TestCase { /** * @return non-empty-list<array{
{ "filepath": "tests/unit/Framework/Constraint/Operator/LogicalXorTest.php", "language": "php", "file_size": 3898, "cut_index": 614, "middle_length": 229 }
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\Constraint; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attribute...
int, mixed}> */ public static function provider(): array { return [ [ true, '', 1234, 1234, ], [ false,
(ExceptionCode::class)] #[CoversClass(Constraint::class)] #[Small] #[Group('framework')] #[Group('framework/constraints')] final class ExceptionCodeTest extends TestCase { /** * @return non-empty-list<array{bool, string,
{ "filepath": "tests/unit/Framework/Constraint/Exception/ExceptionCodeTest.php", "language": "php", "file_size": 2179, "cut_index": 563, "middle_length": 229 }
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\MockObject; use PHPUnit\Framework\Attributes...
teStubForIntersectionOfInterfaces()')] #[DisableReturnValueGenerationForTestDoubles] final class CreateStubForIntersectionOfInterfacesWithDisabledReturnValueGenerationTest extends TestCase { public function testReturnValueGenerationCanBeDisabledWithAtt
stCase; use PHPUnit\TestFixture\MockObject\AnInterface; use PHPUnit\TestFixture\MockObject\AnotherInterface; #[Group('test-doubles')] #[Group('test-doubles/creation')] #[Group('test-doubles/test-stub')] #[Medium] #[TestDox('crea
{ "filepath": "tests/unit/Framework/MockObject/Creation/CreateStubForIntersectionOfInterfacesWithDisabledReturnValueGenerationTest.php", "language": "php", "file_size": 1251, "cut_index": 518, "middle_length": 229 }
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\MockObject; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Medi...
e\MockObject\Enumeration; use PHPUnit\TestFixture\MockObject\ExtendableClass; use PHPUnit\TestFixture\MockObject\ExtendableReadonlyClass; use PHPUnit\TestFixture\MockObject\FinalClass; #[Group('test-doubles')] #[Group('test-doubles/creation')] #[Group('te
PHPUnit\Framework\MockObject\Generator\ClassIsFinalException; use PHPUnit\Framework\MockObject\Generator\UnknownTypeException; use PHPUnit\Framework\TestCase; use PHPUnit\TestFixture\MockObject\AnInterface; use PHPUnit\TestFixtur
{ "filepath": "tests/unit/Framework/MockObject/Creation/CreateStubTest.php", "language": "php", "file_size": 2981, "cut_index": 563, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attributes\CoversClass; use P...
DirectoryCollectionTest extends TestCase { public function testIsCreatedFromArray(): void { $element = $this->element(); $elements = FilterDirectoryCollection::fromArray([$element]); $this->assertSame([$element], $elements
:class)] #[CoversClass(FilterDirectoryCollectionIterator::class)] #[UsesClass(FilterDirectory::class)] #[Small] #[Group('textui')] #[Group('textui/configuration')] #[Group('textui/configuration/value-objects')] final class Filter
{ "filepath": "tests/unit/TextUI/Configuration/Value/FilterDirectoryCollectionTest.php", "language": "php", "file_size": 1751, "cut_index": 537, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attributes...
($path, new FilterDirectory($path, 'prefix', 'suffix')->path()); } public function testHasPrefix(): void { $prefix = 'prefix'; $this->assertSame($prefix, new FilterDirectory('path', $prefix, 'suffix')->prefix()); } pu
] #[Group('textui/configuration')] #[Group('textui/configuration/value-objects')] final class FilterDirectoryTest extends TestCase { public function testHasPath(): void { $path = 'path'; $this->assertSame
{ "filepath": "tests/unit/TextUI/Configuration/Value/FilterDirectoryTest.php", "language": "php", "file_size": 1176, "cut_index": 518, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attributes\CoversClass; use P...
est extends TestCase { public function testIsCreatedFromArray(): void { $element = $this->element(); $elements = FilterFileCollection::fromArray([$element]); $this->assertSame([$element], $elements->asArray()); }
s)] #[CoversClass(FilterFileCollectionIterator::class)] #[UsesClass(FilterFile::class)] #[Small] #[Group('textui')] #[Group('textui/configuration')] #[Group('textui/configuration/value-objects')] final class FilterFileCollectionT
{ "filepath": "tests/unit/TextUI/Configuration/Value/FilterFileCollectionTest.php", "language": "php", "file_size": 1686, "cut_index": 537, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attribu...
new FilterFile($path)->path()); } public function testCanBeIncludedInCodeCoverageAnalysis(): void { $this->assertTrue(new FilterFile('path')->includeInCodeCoverage()); } public function testCanBeExcludedFromCodeCoverageAnalys
#[Group('textui/configuration')] #[Group('textui/configuration/value-objects')] final class FilterFileTest extends TestCase { public function testHasPath(): void { $path = 'path'; $this->assertSame($path,
{ "filepath": "tests/unit/TextUI/Configuration/Value/FilterFileTest.php", "language": "php", "file_size": 1109, "cut_index": 515, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attributes\CoversClass; use P...
] final class GroupCollectionTest extends TestCase { public function testIsCreatedFromArray(): void { $element = $this->element(); $elements = GroupCollection::fromArray([$element]); $this->assertSame([$element], $elements
ass)] #[UsesClass(Group::class)] #[Small] #[\PHPUnit\Framework\Attributes\Group('textui')] #[\PHPUnit\Framework\Attributes\Group('textui/configuration')] #[\PHPUnit\Framework\Attributes\Group('textui/configuration/value-objects')
{ "filepath": "tests/unit/TextUI/Configuration/Value/GroupCollectionTest.php", "language": "php", "file_size": 1802, "cut_index": 537, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attributes\CoversClass; use P...
est extends TestCase { public function testIsCreatedFromArray(): void { $element = $this->element(); $elements = IniSettingCollection::fromArray([$element]); $this->assertSame([$element], $elements->asArray()); }
s)] #[CoversClass(IniSettingCollectionIterator::class)] #[UsesClass(IniSetting::class)] #[Small] #[Group('textui')] #[Group('textui/configuration')] #[Group('textui/configuration/value-objects')] final class IniSettingCollectionT
{ "filepath": "tests/unit/TextUI/Configuration/Value/IniSettingCollectionTest.php", "language": "php", "file_size": 1649, "cut_index": 537, "middle_length": 229 }
* 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\TextUI\Configuration; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Fra...
l class IniSettingTest extends TestCase { public function testHasName(): void { $this->assertSame('name', new IniSetting('name', 'value')->name()); } public function testHasValue(): void { $this->assertSame('value', new
#[Group('textui/configuration/value-objects')] fina
{ "filepath": "tests/unit/TextUI/Configuration/Value/IniSettingTest.php", "language": "php", "file_size": 903, "cut_index": 547, "middle_length": 52 }
tian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\TextUI\Configuration; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Small; us...
bles; private readonly VariableCollection $envVariables; private readonly VariableCollection $postVariables; private readonly VariableCollection $getVariables; private readonly VariableCollection $cookieVariables; private readonly Varia
s TestCase { private readonly DirectoryCollection $includePaths; private readonly IniSettingCollection $iniSettings; private readonly ConstantCollection $constants; private readonly VariableCollection $globalVaria
{ "filepath": "tests/unit/TextUI/Configuration/Value/PhpTest.php", "language": "php", "file_size": 4104, "cut_index": 614, "middle_length": 229 }
figuration')] #[Group('textui/configuration/value-objects')] final class SourceTest extends TestCase { public function testHasIncludeDirectories(): void { $includeDirectories = FilterDirectoryCollection::fromArray([]); $source = new Source( null, false, $incl...
, ], false, false, false, true, ); $this->assertSame($includeDirectories, $source->includeDirectories()); } public function testHasIncludeFiles(): void { $inc
false, false, false, false, false, false, false, false, [ 'functions' => [], 'methods' => []
{ "filepath": "tests/unit/TextUI/Configuration/Value/SourceTest.php", "language": "php", "file_size": 23354, "cut_index": 1331, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attributes\CoversClass; use P...
on/value-objects')] final class TestDirectoryCollectionTest extends TestCase { public function testIsCreatedFromArray(): void { $element = $this->element(); $elements = TestDirectoryCollection::fromArray([$element]); $this
r; #[CoversClass(TestDirectoryCollection::class)] #[CoversClass(TestDirectoryCollectionIterator::class)] #[UsesClass(TestDirectory::class)] #[Small] #[Group('textui')] #[Group('textui/configuration')] #[Group('textui/configurati
{ "filepath": "tests/unit/TextUI/Configuration/Value/TestDirectoryCollectionTest.php", "language": "php", "file_size": 1910, "cut_index": 537, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attributes\CoversClass; use P...
th', $this->fixture()->path()); } public function testHasPrefix(): void { $this->assertSame('prefix', $this->fixture()->prefix()); } public function testHasSuffix(): void { $this->assertSame('suffix', $this->fixtur
mall] #[Group('textui')] #[Group('textui/configuration')] #[Group('textui/configuration/value-objects')] final class TestDirectoryTest extends TestCase { public function testHasPath(): void { $this->assertSame('pa
{ "filepath": "tests/unit/TextUI/Configuration/Value/TestDirectoryTest.php", "language": "php", "file_size": 1707, "cut_index": 537, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attributes\CoversClass; use P...
s')] final class TestFileCollectionTest extends TestCase { public function testIsCreatedFromArray(): void { $element = $this->element(); $elements = TestFileCollection::fromArray([$element]); $this->assertSame([$element],
r; #[CoversClass(TestFileCollection::class)] #[CoversClass(TestFileCollectionIterator::class)] #[UsesClass(TestFile::class)] #[Small] #[Group('textui')] #[Group('textui/configuration')] #[Group('textui/configuration/value-object
{ "filepath": "tests/unit/TextUI/Configuration/Value/TestFileCollectionTest.php", "language": "php", "file_size": 1821, "cut_index": 537, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attributes\Cover...
'path', $this->fixture()->path()); } public function testHasPhpVersion(): void { $this->assertSame('8.2.0', $this->fixture()->phpVersion()); } public function testHasPhpVersionOperator(): void { $this->assertSame('
ss)] #[Small] #[Group('textui')] #[Group('textui/configuration')] #[Group('textui/configuration/value-objects')] final class TestFileTest extends TestCase { public function testHasPath(): void { $this->assertSame(
{ "filepath": "tests/unit/TextUI/Configuration/Value/TestFileTest.php", "language": "php", "file_size": 1403, "cut_index": 524, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attributes\CoversClass; use P...
extends TestCase { public function testIsCreatedFromArray(): void { $element = $this->element(); $elements = TestSuiteCollection::fromArray([$element]); $this->assertSame([$element], $elements->asArray()); } publi
)] #[CoversClass(TestSuiteCollectionIterator::class)] #[UsesClass(TestSuite::class)] #[Small] #[Group('textui')] #[Group('textui/configuration')] #[Group('textui/configuration/value-objects')] final class TestSuiteCollectionTest
{ "filepath": "tests/unit/TextUI/Configuration/Value/TestSuiteCollectionTest.php", "language": "php", "file_size": 1842, "cut_index": 537, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attributes\CoversClass; use P...
ection $files; private readonly FileCollection $excludedFiles; private readonly TestSuite $fixture; protected function setUp(): void { $this->name = 'name'; $this->directories = TestDirectoryCollection::fromArray
ration')] #[Group('textui/configuration/value-objects')] final class TestSuiteTest extends TestCase { private readonly string $name; private readonly TestDirectoryCollection $directories; private readonly TestFileColl
{ "filepath": "tests/unit/TextUI/Configuration/Value/TestSuiteTest.php", "language": "php", "file_size": 1843, "cut_index": 537, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attributes\CoversClass; use P...
nds TestCase { public function testIsCreatedFromArray(): void { $element = $this->element(); $elements = VariableCollection::fromArray([$element]); $this->assertSame([$element], $elements->asArray()); } public fun
] #[CoversClass(VariableCollectionIterator::class)] #[UsesClass(Variable::class)] #[Small] #[Group('textui')] #[Group('textui/configuration')] #[Group('textui/configuration/value-objects')] final class VariableCollectionTest exte
{ "filepath": "tests/unit/TextUI/Configuration/Value/VariableCollectionTest.php", "language": "php", "file_size": 1634, "cut_index": 537, "middle_length": 229 }
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\TextUI\Configuration; use PHPUnit\Framework\Attribu...
', false)->name()); } public function testHasValue(): void { $this->assertSame('value', new Variable('name', 'value', false)->value()); } public function testValueCanBeForced(): void { $this->assertFalse(new Variab
Group('textui/configuration')] #[Group('textui/configuration/value-objects')] final class VariableTest extends TestCase { public function testHasName(): void { $this->assertSame('name', new Variable('name', 'value
{ "filepath": "tests/unit/TextUI/Configuration/Value/VariableTest.php", "language": "php", "file_size": 1119, "cut_index": 515, "middle_length": 229 }
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\TextUI\Command; use PHPUnit\Framework\Attributes\Cover...
mand->execute(); $this->assertSame('', $result->output()); $this->assertSame(0, $result->shellExitCode()); } public function testFailsWhenRequirementIsNotMet(): void { $command = new AtLeastVersionCommand('100');
] #[Group('textui/commands')] final class AtLeastVersionCommandTest extends TestCase { public function testSucceedsWhenRequirementIsMet(): void { $command = new AtLeastVersionCommand('10'); $result = $com
{ "filepath": "tests/unit/TextUI/Command/Commands/AtLeastVersionCommandTest.php", "language": "php", "file_size": 1153, "cut_index": 518, "middle_length": 229 }
tian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\TextUI\Command; use const PHP_EOL; use function realpath; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PH...
tBalanceIsInitiallyZero'); $command = new ListTestIdsCommand([$test]); $result = $command->execute(); $this->assertSame( 'PHPUnit\TestFixture\BankAccountTest::testBalanceIsInitiallyZero' . PHP_EOL, $result
class)] #[Small] #[Group('textui')] #[Group('textui/commands')] final class ListTestIdsCommandTest extends TestCase { public function testListsTestIdForTestWithoutDataSet(): void { $test = new BankAccountTest('tes
{ "filepath": "tests/unit/TextUI/Command/Commands/ListTestIdsCommandTest.php", "language": "php", "file_size": 3227, "cut_index": 614, "middle_length": 229 }
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\TextUI\Command; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit...
mand( __DIR__ . '/../../../../end-to-end/cli/validate-configuration/_files/valid/phpunit.xml', ); $result = $command->execute(); $this->assertSame(Result::SUCCESS, $result->shellExitCode()); $this->assertString
[Group('textui')] #[Group('textui/commands')] final class ValidateConfigurationCommandTest extends TestCase { public function testSucceedsForValidConfigurationFile(): void { $command = new ValidateConfigurationCom
{ "filepath": "tests/unit/TextUI/Command/Commands/ValidateConfigurationCommandTest.php", "language": "php", "file_size": 2007, "cut_index": 537, "middle_length": 229 }
tian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\TextUI\Command; use const PHP_EOL; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\...
3: non-empty-string, 4: non-empty-string, 5: non-empty-string}> */ public static function provider(): array { return [ [ 'You are using the latest version of PHPUnit.' . PHP_EOL, Result::SUCC
mmand::class)] #[Small] #[Group('textui')] #[Group('textui/commands')] final class VersionCheckCommandTest extends TestCase { /** * @return non-empty-list<array{0: non-empty-string, 1: non-negative-int, 2: positive-int,
{ "filepath": "tests/unit/TextUI/Command/Commands/VersionCheckCommandTest.php", "language": "php", "file_size": 3297, "cut_index": 614, "middle_length": 229 }
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\TextUI\Output\Default; use PHPUnit\Framework\Attributes\CoversClass; use ...
lic static function providePrinter(): array { $data = [ 'standard output' => [DefaultPrinter::standardOutput()], 'standard error' => [DefaultPrinter::standardError()], ]; try { $data['socket
etException; use PHPUnit\TextUI\Output\DefaultPrinter; #[CoversClass(DefaultPrinter::class)] #[Medium] final class DefaultPrinterTest extends TestCase { /** * @return array<string, array{DefaultPrinter}> */ pub
{ "filepath": "tests/unit/TextUI/Output/Default/DefaultPrinterTest.php", "language": "php", "file_size": 1534, "cut_index": 537, "middle_length": 229 }