From 67ae4d8f94660e2177d11d4f732e82ff42cecc2a Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sat, 7 Dec 2024 17:44:14 +0100 Subject: [PATCH] Closes #5984 and #5985 --- ChangeLog-12.0.md | 5 + .../CoversClassesThatExtendClass.php | 42 ++ .../CoversClassesThatImplementInterface.php | 42 ++ .../Attributes/UsesClassesThatExtendClass.php | 42 ++ .../UsesClassesThatImplementInterface.php | 42 ++ src/Metadata/Api/CodeCoverage.php | 28 + src/Metadata/CoversClassesThatExtendClass.php | 46 ++ .../CoversClassesThatImplementInterface.php | 47 ++ src/Metadata/Metadata.php | 64 +++ src/Metadata/MetadataCollection.php | 40 ++ src/Metadata/Parser/AttributeParser.php | 32 ++ src/Metadata/UsesClassesThatExtendClass.php | 47 ++ .../UsesClassesThatImplementInterface.php | 47 ++ .../Metadata/Attribute/tests/CoversTest.php | 4 + .../Metadata/Attribute/tests/UsesTest.php | 4 + .../unit/Metadata/MetadataCollectionTest.php | 36 ++ tests/unit/Metadata/MetadataTest.php | 484 ++++++++++++++++++ .../Parser/AttributeParserTestCase.php | 40 ++ 18 files changed, 1092 insertions(+) create mode 100644 src/Framework/Attributes/CoversClassesThatExtendClass.php create mode 100644 src/Framework/Attributes/CoversClassesThatImplementInterface.php create mode 100644 src/Framework/Attributes/UsesClassesThatExtendClass.php create mode 100644 src/Framework/Attributes/UsesClassesThatImplementInterface.php create mode 100644 src/Metadata/CoversClassesThatExtendClass.php create mode 100644 src/Metadata/CoversClassesThatImplementInterface.php create mode 100644 src/Metadata/UsesClassesThatExtendClass.php create mode 100644 src/Metadata/UsesClassesThatImplementInterface.php diff --git a/ChangeLog-12.0.md b/ChangeLog-12.0.md index b95b991007a..9d571832e78 100644 --- a/ChangeLog-12.0.md +++ b/ChangeLog-12.0.md @@ -4,6 +4,11 @@ All notable changes of the PHPUnit 12.0 release series are documented in this fi ## [12.0.0] - 2025-02-07 +### Added + +* [#5984](https://github.com/sebastianbergmann/phpunit/issues/5984): `#[CoversClassesThatExtendClass]` and `#[UsesClassesThatExtendClass]` +* [#5985](https://github.com/sebastianbergmann/phpunit/issues/5985): `#[CoversClassesThatImplementInterface]` and `#[UsesClassesThatImplementInterface]` + ### Changed * [#5872](https://github.com/sebastianbergmann/phpunit/issues/5872): The default value for `shortenArraysForExportThreshold` is now `10` (limit export of arrays to 10 levels) instead of `0` (do not limit export of arrays) diff --git a/src/Framework/Attributes/CoversClassesThatExtendClass.php b/src/Framework/Attributes/CoversClassesThatExtendClass.php new file mode 100644 index 00000000000..486fc5b0a7a --- /dev/null +++ b/src/Framework/Attributes/CoversClassesThatExtendClass.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\Framework\Attributes; + +use Attribute; + +/** + * @immutable + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + */ +#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)] +final readonly class CoversClassesThatExtendClass +{ + /** + * @var class-string + */ + private string $className; + + /** + * @param class-string $className + */ + public function __construct(string $className) + { + $this->className = $className; + } + + /** + * @return class-string + */ + public function className(): string + { + return $this->className; + } +} diff --git a/src/Framework/Attributes/CoversClassesThatImplementInterface.php b/src/Framework/Attributes/CoversClassesThatImplementInterface.php new file mode 100644 index 00000000000..69bcd84603b --- /dev/null +++ b/src/Framework/Attributes/CoversClassesThatImplementInterface.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\Framework\Attributes; + +use Attribute; + +/** + * @immutable + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + */ +#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)] +final readonly class CoversClassesThatImplementInterface +{ + /** + * @var class-string + */ + private string $interfaceName; + + /** + * @param class-string $interfaceName + */ + public function __construct(string $interfaceName) + { + $this->interfaceName = $interfaceName; + } + + /** + * @return class-string + */ + public function interfaceName(): string + { + return $this->interfaceName; + } +} diff --git a/src/Framework/Attributes/UsesClassesThatExtendClass.php b/src/Framework/Attributes/UsesClassesThatExtendClass.php new file mode 100644 index 00000000000..d1aa73faa88 --- /dev/null +++ b/src/Framework/Attributes/UsesClassesThatExtendClass.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\Framework\Attributes; + +use Attribute; + +/** + * @immutable + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + */ +#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)] +final readonly class UsesClassesThatExtendClass +{ + /** + * @var class-string + */ + private string $className; + + /** + * @param class-string $className + */ + public function __construct(string $className) + { + $this->className = $className; + } + + /** + * @return class-string + */ + public function className(): string + { + return $this->className; + } +} diff --git a/src/Framework/Attributes/UsesClassesThatImplementInterface.php b/src/Framework/Attributes/UsesClassesThatImplementInterface.php new file mode 100644 index 00000000000..0f2241c8675 --- /dev/null +++ b/src/Framework/Attributes/UsesClassesThatImplementInterface.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\Framework\Attributes; + +use Attribute; + +/** + * @immutable + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + */ +#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)] +final readonly class UsesClassesThatImplementInterface +{ + /** + * @var class-string + */ + private string $interfaceName; + + /** + * @param class-string $interfaceName + */ + public function __construct(string $interfaceName) + { + $this->interfaceName = $interfaceName; + } + + /** + * @return class-string + */ + public function interfaceName(): string + { + return $this->interfaceName; + } +} diff --git a/src/Metadata/Api/CodeCoverage.php b/src/Metadata/Api/CodeCoverage.php index 5a592726850..d227a7bceea 100644 --- a/src/Metadata/Api/CodeCoverage.php +++ b/src/Metadata/Api/CodeCoverage.php @@ -11,10 +11,14 @@ use function assert; use PHPUnit\Metadata\CoversClass; +use PHPUnit\Metadata\CoversClassesThatExtendClass; +use PHPUnit\Metadata\CoversClassesThatImplementInterface; use PHPUnit\Metadata\CoversFunction; use PHPUnit\Metadata\CoversMethod; use PHPUnit\Metadata\Parser\Registry; use PHPUnit\Metadata\UsesClass; +use PHPUnit\Metadata\UsesClassesThatExtendClass; +use PHPUnit\Metadata\UsesClassesThatImplementInterface; use PHPUnit\Metadata\UsesFunction; use PHPUnit\Metadata\UsesMethod; use SebastianBergmann\CodeCoverage\Test\Target\Target; @@ -46,6 +50,18 @@ public function coversTargets(string $className, string $methodName): false|Targ $targets[] = Target::forClass($metadata->className()); } + if ($metadata->isCoversClassesThatExtendClass()) { + assert($metadata instanceof CoversClassesThatExtendClass); + + $targets[] = Target::forClassesThatExtendClass($metadata->className()); + } + + if ($metadata->isCoversClassesThatImplementInterface()) { + assert($metadata instanceof CoversClassesThatImplementInterface); + + $targets[] = Target::forClassesThatImplementInterface($metadata->interfaceName()); + } + if ($metadata->isCoversMethod()) { assert($metadata instanceof CoversMethod); @@ -77,6 +93,18 @@ public function usesTargets(string $className, string $methodName): TargetCollec $targets[] = Target::forClass($metadata->className()); } + if ($metadata->isUsesClassesThatExtendClass()) { + assert($metadata instanceof UsesClassesThatExtendClass); + + $targets[] = Target::forClassesThatExtendClass($metadata->className()); + } + + if ($metadata->isUsesClassesThatImplementInterface()) { + assert($metadata instanceof UsesClassesThatImplementInterface); + + $targets[] = Target::forClassesThatImplementInterface($metadata->interfaceName()); + } + if ($metadata->isUsesMethod()) { assert($metadata instanceof UsesMethod); diff --git a/src/Metadata/CoversClassesThatExtendClass.php b/src/Metadata/CoversClassesThatExtendClass.php new file mode 100644 index 00000000000..abe524a4dd5 --- /dev/null +++ b/src/Metadata/CoversClassesThatExtendClass.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\Metadata; + +/** + * @immutable + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + */ +final readonly class CoversClassesThatExtendClass extends Metadata +{ + /** + * @var class-string + */ + private string $className; + + /** + * @param 0|1 $level + */ + protected function __construct(int $level, string $className) + { + parent::__construct($level); + + $this->className = $className; + } + + public function isCoversClassesThatExtendClass(): true + { + return true; + } + + /** + * @return class-string + */ + public function className(): string + { + return $this->className; + } +} diff --git a/src/Metadata/CoversClassesThatImplementInterface.php b/src/Metadata/CoversClassesThatImplementInterface.php new file mode 100644 index 00000000000..70081e0fb6d --- /dev/null +++ b/src/Metadata/CoversClassesThatImplementInterface.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\Metadata; + +/** + * @immutable + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + */ +final readonly class CoversClassesThatImplementInterface extends Metadata +{ + /** + * @var class-string + */ + private string $interfaceName; + + /** + * @param 0|1 $level + * @param class-string $interfaceName + */ + protected function __construct(int $level, string $interfaceName) + { + parent::__construct($level); + + $this->interfaceName = $interfaceName; + } + + public function isCoversClassesThatImplementInterface(): true + { + return true; + } + + /** + * @return class-string + */ + public function interfaceName(): string + { + return $this->interfaceName; + } +} diff --git a/src/Metadata/Metadata.php b/src/Metadata/Metadata.php index 137fe8b6a8f..9570f6557ee 100644 --- a/src/Metadata/Metadata.php +++ b/src/Metadata/Metadata.php @@ -87,6 +87,22 @@ public static function coversClass(string $className): CoversClass return new CoversClass(self::CLASS_LEVEL, $className); } + /** + * @param class-string $className + */ + public static function coversClassesThatExtendClass(string $className): CoversClassesThatExtendClass + { + return new CoversClassesThatExtendClass(self::CLASS_LEVEL, $className); + } + + /** + * @param class-string $interfaceName + */ + public static function coversClassesThatImplementInterface(string $interfaceName): CoversClassesThatImplementInterface + { + return new CoversClassesThatImplementInterface(self::CLASS_LEVEL, $interfaceName); + } + /** * @param class-string $className * @param non-empty-string $methodName @@ -446,6 +462,22 @@ public static function usesClass(string $className): UsesClass return new UsesClass(self::CLASS_LEVEL, $className); } + /** + * @param class-string $className + */ + public static function usesClassesThatExtendClass(string $className): UsesClassesThatExtendClass + { + return new UsesClassesThatExtendClass(self::CLASS_LEVEL, $className); + } + + /** + * @param class-string $interfaceName + */ + public static function usesClassesThatImplementInterface(string $interfaceName): UsesClassesThatImplementInterface + { + return new UsesClassesThatImplementInterface(self::CLASS_LEVEL, $interfaceName); + } + /** * @param non-empty-string $functionName */ @@ -542,6 +574,22 @@ public function isCoversClass(): bool return false; } + /** + * @phpstan-assert-if-true CoversClassesThatExtendClass $this + */ + public function isCoversClassesThatExtendClass(): bool + { + return false; + } + + /** + * @phpstan-assert-if-true CoversClassesThatImplementInterface $this + */ + public function isCoversClassesThatImplementInterface(): bool + { + return false; + } + /** * @phpstan-assert-if-true CoversFunction $this */ @@ -800,6 +848,22 @@ public function isUsesClass(): bool return false; } + /** + * @phpstan-assert-if-true UsesClassesThatExtendClass $this + */ + public function isUsesClassesThatExtendClass(): bool + { + return false; + } + + /** + * @phpstan-assert-if-true UsesClassesThatImplementInterface $this + */ + public function isUsesClassesThatImplementInterface(): bool + { + return false; + } + /** * @phpstan-assert-if-true UsesFunction $this */ diff --git a/src/Metadata/MetadataCollection.php b/src/Metadata/MetadataCollection.php index 083e97d7fa8..2bd8ce9aa52 100644 --- a/src/Metadata/MetadataCollection.php +++ b/src/Metadata/MetadataCollection.php @@ -170,6 +170,26 @@ public function isCoversClass(): self ); } + public function isCoversClassesThatExtendClass(): self + { + return new self( + ...array_filter( + $this->metadata, + static fn (Metadata $metadata): bool => $metadata->isCoversClassesThatExtendClass(), + ), + ); + } + + public function isCoversClassesThatImplementInterface(): self + { + return new self( + ...array_filter( + $this->metadata, + static fn (Metadata $metadata): bool => $metadata->isCoversClassesThatImplementInterface(), + ), + ); + } + public function isCoversFunction(): self { return new self( @@ -503,6 +523,26 @@ public function isUsesClass(): self ); } + public function isUsesClassesThatExtendClass(): self + { + return new self( + ...array_filter( + $this->metadata, + static fn (Metadata $metadata): bool => $metadata->isUsesClassesThatExtendClass(), + ), + ); + } + + public function isUsesClassesThatImplementInterface(): self + { + return new self( + ...array_filter( + $this->metadata, + static fn (Metadata $metadata): bool => $metadata->isUsesClassesThatImplementInterface(), + ), + ); + } + public function isUsesFunction(): self { return new self( diff --git a/src/Metadata/Parser/AttributeParser.php b/src/Metadata/Parser/AttributeParser.php index 0496a4930c3..3fce3dd31ff 100644 --- a/src/Metadata/Parser/AttributeParser.php +++ b/src/Metadata/Parser/AttributeParser.php @@ -26,6 +26,8 @@ use PHPUnit\Framework\Attributes\Before; use PHPUnit\Framework\Attributes\BeforeClass; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\CoversClassesThatExtendClass; +use PHPUnit\Framework\Attributes\CoversClassesThatImplementInterface; use PHPUnit\Framework\Attributes\CoversFunction; use PHPUnit\Framework\Attributes\CoversMethod; use PHPUnit\Framework\Attributes\CoversNothing; @@ -71,6 +73,8 @@ use PHPUnit\Framework\Attributes\TestWithJson; use PHPUnit\Framework\Attributes\Ticket; use PHPUnit\Framework\Attributes\UsesClass; +use PHPUnit\Framework\Attributes\UsesClassesThatExtendClass; +use PHPUnit\Framework\Attributes\UsesClassesThatImplementInterface; use PHPUnit\Framework\Attributes\UsesFunction; use PHPUnit\Framework\Attributes\UsesMethod; use PHPUnit\Framework\Attributes\WithoutErrorHandler; @@ -129,6 +133,20 @@ public function forClass(string $className): MetadataCollection break; + case CoversClassesThatExtendClass::class: + assert($attributeInstance instanceof CoversClassesThatExtendClass); + + $result[] = Metadata::coversClassesThatExtendClass($attributeInstance->className()); + + break; + + case CoversClassesThatImplementInterface::class: + assert($attributeInstance instanceof CoversClassesThatImplementInterface); + + $result[] = Metadata::coversClassesThatImplementInterface($attributeInstance->interfaceName()); + + break; + case CoversFunction::class: assert($attributeInstance instanceof CoversFunction); @@ -343,6 +361,20 @@ public function forClass(string $className): MetadataCollection break; + case UsesClassesThatExtendClass::class: + assert($attributeInstance instanceof UsesClassesThatExtendClass); + + $result[] = Metadata::usesClassesThatExtendClass($attributeInstance->className()); + + break; + + case UsesClassesThatImplementInterface::class: + assert($attributeInstance instanceof UsesClassesThatImplementInterface); + + $result[] = Metadata::usesClassesThatImplementInterface($attributeInstance->interfaceName()); + + break; + case UsesFunction::class: assert($attributeInstance instanceof UsesFunction); diff --git a/src/Metadata/UsesClassesThatExtendClass.php b/src/Metadata/UsesClassesThatExtendClass.php new file mode 100644 index 00000000000..4dd2584b865 --- /dev/null +++ b/src/Metadata/UsesClassesThatExtendClass.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\Metadata; + +/** + * @immutable + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + */ +final readonly class UsesClassesThatExtendClass extends Metadata +{ + /** + * @var class-string + */ + private string $className; + + /** + * @param 0|1 $level + * @param class-string $className + */ + protected function __construct(int $level, string $className) + { + parent::__construct($level); + + $this->className = $className; + } + + public function isUsesClassesThatExtendClass(): true + { + return true; + } + + /** + * @return class-string + */ + public function className(): string + { + return $this->className; + } +} diff --git a/src/Metadata/UsesClassesThatImplementInterface.php b/src/Metadata/UsesClassesThatImplementInterface.php new file mode 100644 index 00000000000..b42e754951f --- /dev/null +++ b/src/Metadata/UsesClassesThatImplementInterface.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\Metadata; + +/** + * @immutable + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + */ +final readonly class UsesClassesThatImplementInterface extends Metadata +{ + /** + * @var class-string + */ + private string $interfaceName; + + /** + * @param 0|1 $level + * @param class-string $interfaceName + */ + protected function __construct(int $level, string $interfaceName) + { + parent::__construct($level); + + $this->interfaceName = $interfaceName; + } + + public function isUsesClassesThatImplementInterface(): true + { + return true; + } + + /** + * @return class-string + */ + public function interfaceName(): string + { + return $this->interfaceName; + } +} diff --git a/tests/_files/Metadata/Attribute/tests/CoversTest.php b/tests/_files/Metadata/Attribute/tests/CoversTest.php index 963d58bf2cf..44a8777a5dc 100644 --- a/tests/_files/Metadata/Attribute/tests/CoversTest.php +++ b/tests/_files/Metadata/Attribute/tests/CoversTest.php @@ -10,12 +10,16 @@ namespace PHPUnit\TestFixture\Metadata\Attribute; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\CoversClassesThatExtendClass; +use PHPUnit\Framework\Attributes\CoversClassesThatImplementInterface; use PHPUnit\Framework\Attributes\CoversFunction; use PHPUnit\Framework\Attributes\CoversMethod; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\TestCase; #[CoversClass(Example::class)] +#[CoversClassesThatExtendClass(Example::class)] +#[CoversClassesThatImplementInterface(Example::class)] #[CoversMethod(Example::class, 'method')] #[CoversFunction('f')] #[CoversNothing] diff --git a/tests/_files/Metadata/Attribute/tests/UsesTest.php b/tests/_files/Metadata/Attribute/tests/UsesTest.php index 4d0acef6594..9741fc21b1c 100644 --- a/tests/_files/Metadata/Attribute/tests/UsesTest.php +++ b/tests/_files/Metadata/Attribute/tests/UsesTest.php @@ -10,11 +10,15 @@ namespace PHPUnit\TestFixture\Metadata\Attribute; use PHPUnit\Framework\Attributes\UsesClass; +use PHPUnit\Framework\Attributes\UsesClassesThatExtendClass; +use PHPUnit\Framework\Attributes\UsesClassesThatImplementInterface; use PHPUnit\Framework\Attributes\UsesFunction; use PHPUnit\Framework\Attributes\UsesMethod; use PHPUnit\Framework\TestCase; #[UsesClass(Example::class)] +#[UsesClassesThatExtendClass(Example::class)] +#[UsesClassesThatImplementInterface(Example::class)] #[UsesMethod(Example::class, 'method')] #[UsesFunction('f')] final class UsesTest extends TestCase diff --git a/tests/unit/Metadata/MetadataCollectionTest.php b/tests/unit/Metadata/MetadataCollectionTest.php index 733771b4dbd..8f7cd49c7a8 100644 --- a/tests/unit/Metadata/MetadataCollectionTest.php +++ b/tests/unit/Metadata/MetadataCollectionTest.php @@ -185,6 +185,22 @@ public function test_Can_be_filtered_for_CoversClass(): void $this->assertTrue($collection->asArray()[0]->isCoversClass()); } + public function test_Can_be_filtered_for_CoversClassesThatExtendClass(): void + { + $collection = $this->collectionWithOneOfEach()->isCoversClassesThatExtendClass(); + + $this->assertCount(1, $collection); + $this->assertTrue($collection->asArray()[0]->isCoversClassesThatExtendClass()); + } + + public function test_Can_be_filtered_for_CoversClassesThatImplementInterface(): void + { + $collection = $this->collectionWithOneOfEach()->isCoversClassesThatImplementInterface(); + + $this->assertCount(1, $collection); + $this->assertTrue($collection->asArray()[0]->isCoversClassesThatImplementInterface()); + } + public function test_Can_be_filtered_for_CoversFunction(): void { $collection = $this->collectionWithOneOfEach()->isCoversFunction(); @@ -450,6 +466,22 @@ public function test_Can_be_filtered_for_UsesClass(): void $this->assertTrue($collection->asArray()[0]->isUsesClass()); } + public function test_Can_be_filtered_for_UsesClassesThatExtendClass(): void + { + $collection = $this->collectionWithOneOfEach()->isUsesClassesThatExtendClass(); + + $this->assertCount(1, $collection); + $this->assertTrue($collection->asArray()[0]->isUsesClassesThatExtendClass()); + } + + public function test_Can_be_filtered_for_UsesClassesThatImplementInterface(): void + { + $collection = $this->collectionWithOneOfEach()->isUsesClassesThatImplementInterface(); + + $this->assertCount(1, $collection); + $this->assertTrue($collection->asArray()[0]->isUsesClassesThatImplementInterface()); + } + public function test_Can_be_filtered_for_UsesFunction(): void { $collection = $this->collectionWithOneOfEach()->isUsesFunction(); @@ -485,6 +517,8 @@ private function collectionWithOneOfEach(): MetadataCollection Metadata::beforeClass(0), Metadata::before(0), Metadata::coversClass(''), + Metadata::coversClassesThatExtendClass(''), + Metadata::coversClassesThatImplementInterface(''), Metadata::coversFunction(''), Metadata::coversMethod('', ''), Metadata::coversNothingOnClass(), @@ -527,6 +561,8 @@ private function collectionWithOneOfEach(): MetadataCollection Metadata::test(), Metadata::testWith([]), Metadata::usesClass(''), + Metadata::usesClassesThatExtendClass(''), + Metadata::usesClassesThatImplementInterface(''), Metadata::usesFunction(''), Metadata::usesMethod('', ''), Metadata::withoutErrorHandler(), diff --git a/tests/unit/Metadata/MetadataTest.php b/tests/unit/Metadata/MetadataTest.php index efe74bf4333..7d08545a81c 100644 --- a/tests/unit/Metadata/MetadataTest.php +++ b/tests/unit/Metadata/MetadataTest.php @@ -23,6 +23,8 @@ #[CoversClass(Before::class)] #[CoversClass(BeforeClass::class)] #[CoversClass(\PHPUnit\Metadata\CoversClass::class)] +#[CoversClass(CoversClassesThatExtendClass::class)] +#[CoversClass(CoversClassesThatImplementInterface::class)] #[CoversClass(CoversFunction::class)] #[CoversClass(CoversMethod::class)] #[CoversClass(UsesMethod::class)] @@ -57,6 +59,8 @@ #[CoversClass(TestDox::class)] #[CoversClass(TestWith::class)] #[CoversClass(UsesClass::class)] +#[CoversClass(UsesClassesThatExtendClass::class)] +#[CoversClass(UsesClassesThatImplementInterface::class)] #[CoversClass(UsesFunction::class)] #[CoversClass(WithoutErrorHandler::class)] #[Small] @@ -74,6 +78,8 @@ public function testCanBeAfter(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -107,6 +113,8 @@ public function testCanBeAfter(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -126,6 +134,8 @@ public function testCanBeAfterClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -158,6 +168,8 @@ public function testCanBeAfterClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -177,6 +189,8 @@ public function testCanBeBackupGlobalsOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -209,6 +223,8 @@ public function testCanBeBackupGlobalsOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -229,6 +245,8 @@ public function testCanBeBackupGlobalsOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -261,6 +279,8 @@ public function testCanBeBackupGlobalsOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -281,6 +301,8 @@ public function testCanBeBackupStaticPropertiesOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -313,6 +335,8 @@ public function testCanBeBackupStaticPropertiesOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -333,6 +357,8 @@ public function testCanBeBackupStaticPropertiesOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -365,6 +391,8 @@ public function testCanBeBackupStaticPropertiesOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -385,6 +413,8 @@ public function testCanBeBeforeClass(): void $this->assertTrue($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -417,6 +447,8 @@ public function testCanBeBeforeClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -436,6 +468,8 @@ public function testCanBeBefore(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertTrue($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -468,6 +502,8 @@ public function testCanBeBefore(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -487,6 +523,8 @@ public function testCanBeCoversClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertTrue($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -519,6 +557,8 @@ public function testCanBeCoversClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -530,6 +570,120 @@ public function testCanBeCoversClass(): void $this->assertFalse($metadata->isMethodLevel()); } + public function testCanBeCoversClassesThatExtendClass(): void + { + $metadata = Metadata::coversClassesThatExtendClass(self::class); + + $this->assertFalse($metadata->isAfter()); + $this->assertFalse($metadata->isAfterClass()); + $this->assertFalse($metadata->isBackupGlobals()); + $this->assertFalse($metadata->isBackupStaticProperties()); + $this->assertFalse($metadata->isBeforeClass()); + $this->assertFalse($metadata->isBefore()); + $this->assertFalse($metadata->isCoversClass()); + $this->assertTrue($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); + $this->assertFalse($metadata->isCoversFunction()); + $this->assertFalse($metadata->isCoversMethod()); + $this->assertFalse($metadata->isCoversNothing()); + $this->assertFalse($metadata->isDataProvider()); + $this->assertFalse($metadata->isDependsOnClass()); + $this->assertFalse($metadata->isDependsOnMethod()); + $this->assertFalse($metadata->isDisableReturnValueGenerationForTestDoubles()); + $this->assertFalse($metadata->isDoesNotPerformAssertions()); + $this->assertFalse($metadata->isExcludeGlobalVariableFromBackup()); + $this->assertFalse($metadata->isExcludeStaticPropertyFromBackup()); + $this->assertFalse($metadata->isGroup()); + $this->assertFalse($metadata->isIgnoreDeprecations()); + $this->assertFalse($metadata->isIgnorePhpunitDeprecations()); + $this->assertFalse($metadata->isRunClassInSeparateProcess()); + $this->assertFalse($metadata->isRunInSeparateProcess()); + $this->assertFalse($metadata->isRunTestsInSeparateProcesses()); + $this->assertFalse($metadata->isTest()); + $this->assertFalse($metadata->isPreCondition()); + $this->assertFalse($metadata->isPostCondition()); + $this->assertFalse($metadata->isPreserveGlobalState()); + $this->assertFalse($metadata->isRequiresMethod()); + $this->assertFalse($metadata->isRequiresFunction()); + $this->assertFalse($metadata->isRequiresOperatingSystem()); + $this->assertFalse($metadata->isRequiresOperatingSystemFamily()); + $this->assertFalse($metadata->isRequiresPhp()); + $this->assertFalse($metadata->isRequiresPhpExtension()); + $this->assertFalse($metadata->isRequiresPhpunit()); + $this->assertFalse($metadata->isRequiresPhpunitExtension()); + $this->assertFalse($metadata->isRequiresSetting()); + $this->assertFalse($metadata->isTestDox()); + $this->assertFalse($metadata->isTestWith()); + $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); + $this->assertFalse($metadata->isUsesFunction()); + $this->assertFalse($metadata->isUsesMethod()); + $this->assertFalse($metadata->isWithoutErrorHandler()); + + $this->assertSame(self::class, $metadata->className()); + + $this->assertTrue($metadata->isClassLevel()); + $this->assertFalse($metadata->isMethodLevel()); + } + + public function testCanBeCoversClassesThatImplementInterface(): void + { + $metadata = Metadata::coversClassesThatImplementInterface(self::class); + + $this->assertFalse($metadata->isAfter()); + $this->assertFalse($metadata->isAfterClass()); + $this->assertFalse($metadata->isBackupGlobals()); + $this->assertFalse($metadata->isBackupStaticProperties()); + $this->assertFalse($metadata->isBeforeClass()); + $this->assertFalse($metadata->isBefore()); + $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertTrue($metadata->isCoversClassesThatImplementInterface()); + $this->assertFalse($metadata->isCoversFunction()); + $this->assertFalse($metadata->isCoversMethod()); + $this->assertFalse($metadata->isCoversNothing()); + $this->assertFalse($metadata->isDataProvider()); + $this->assertFalse($metadata->isDependsOnClass()); + $this->assertFalse($metadata->isDependsOnMethod()); + $this->assertFalse($metadata->isDisableReturnValueGenerationForTestDoubles()); + $this->assertFalse($metadata->isDoesNotPerformAssertions()); + $this->assertFalse($metadata->isExcludeGlobalVariableFromBackup()); + $this->assertFalse($metadata->isExcludeStaticPropertyFromBackup()); + $this->assertFalse($metadata->isGroup()); + $this->assertFalse($metadata->isIgnoreDeprecations()); + $this->assertFalse($metadata->isIgnorePhpunitDeprecations()); + $this->assertFalse($metadata->isRunClassInSeparateProcess()); + $this->assertFalse($metadata->isRunInSeparateProcess()); + $this->assertFalse($metadata->isRunTestsInSeparateProcesses()); + $this->assertFalse($metadata->isTest()); + $this->assertFalse($metadata->isPreCondition()); + $this->assertFalse($metadata->isPostCondition()); + $this->assertFalse($metadata->isPreserveGlobalState()); + $this->assertFalse($metadata->isRequiresMethod()); + $this->assertFalse($metadata->isRequiresFunction()); + $this->assertFalse($metadata->isRequiresOperatingSystem()); + $this->assertFalse($metadata->isRequiresOperatingSystemFamily()); + $this->assertFalse($metadata->isRequiresPhp()); + $this->assertFalse($metadata->isRequiresPhpExtension()); + $this->assertFalse($metadata->isRequiresPhpunit()); + $this->assertFalse($metadata->isRequiresPhpunitExtension()); + $this->assertFalse($metadata->isRequiresSetting()); + $this->assertFalse($metadata->isTestDox()); + $this->assertFalse($metadata->isTestWith()); + $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); + $this->assertFalse($metadata->isUsesFunction()); + $this->assertFalse($metadata->isUsesMethod()); + $this->assertFalse($metadata->isWithoutErrorHandler()); + + $this->assertSame(self::class, $metadata->interfaceName()); + + $this->assertTrue($metadata->isClassLevel()); + $this->assertFalse($metadata->isMethodLevel()); + } + public function testCanBeCoversFunction(): void { $metadata = Metadata::coversFunction('f'); @@ -541,6 +695,8 @@ public function testCanBeCoversFunction(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertTrue($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversNothing()); $this->assertFalse($metadata->isDataProvider()); @@ -572,6 +728,8 @@ public function testCanBeCoversFunction(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -594,6 +752,8 @@ public function testCanBeCoversMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertTrue($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -626,6 +786,8 @@ public function testCanBeCoversMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -649,6 +811,8 @@ public function testCanBeCoversNothingOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertTrue($metadata->isCoversNothing()); @@ -681,6 +845,8 @@ public function testCanBeCoversNothingOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -700,6 +866,8 @@ public function testCanBeCoversNothingOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertTrue($metadata->isCoversNothing()); @@ -732,6 +900,8 @@ public function testCanBeCoversNothingOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -751,6 +921,8 @@ public function testCanBeDataProvider(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -783,6 +955,8 @@ public function testCanBeDataProvider(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -805,6 +979,8 @@ public function testCanBeDependsOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -837,6 +1013,8 @@ public function testCanBeDependsOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -860,6 +1038,8 @@ public function testCanBeDependsOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -892,6 +1072,8 @@ public function testCanBeDependsOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -916,6 +1098,8 @@ public function testCanBeDisableReturnValueGenerationForTestDoubles(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -948,6 +1132,8 @@ public function testCanBeDisableReturnValueGenerationForTestDoubles(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -967,6 +1153,8 @@ public function testCanBeDoesNotPerformAssertionsOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -999,6 +1187,8 @@ public function testCanBeDoesNotPerformAssertionsOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1018,6 +1208,8 @@ public function testCanBeDoesNotPerformAssertionsOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1050,6 +1242,8 @@ public function testCanBeDoesNotPerformAssertionsOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1069,6 +1263,8 @@ public function testCanBeExcludeGlobalVariableFromBackupOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1101,6 +1297,8 @@ public function testCanBeExcludeGlobalVariableFromBackupOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1121,6 +1319,8 @@ public function testCanBeExcludeGlobalVariableFromBackupOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1153,6 +1353,8 @@ public function testCanBeExcludeGlobalVariableFromBackupOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1173,6 +1375,8 @@ public function testCanBeExcludeStaticPropertyFromBackupOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1205,6 +1409,8 @@ public function testCanBeExcludeStaticPropertyFromBackupOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1227,6 +1433,8 @@ public function testCanBeExcludeStaticPropertyFromBackupOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1259,6 +1467,8 @@ public function testCanBeExcludeStaticPropertyFromBackupOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1281,6 +1491,8 @@ public function testCanBeGroupOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1313,6 +1525,8 @@ public function testCanBeGroupOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1334,6 +1548,8 @@ public function testCanBeIgnoreDeprecationsOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1366,6 +1582,8 @@ public function testCanBeIgnoreDeprecationsOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1385,6 +1603,8 @@ public function testCanBeIgnoreDeprecationsOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1417,6 +1637,8 @@ public function testCanBeIgnoreDeprecationsOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1436,6 +1658,8 @@ public function testCanBeIgnorePhpunitDeprecationsOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1468,6 +1692,8 @@ public function testCanBeIgnorePhpunitDeprecationsOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1487,6 +1713,8 @@ public function testCanBeIgnorePhpunitDeprecationsOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1519,6 +1747,8 @@ public function testCanBeIgnorePhpunitDeprecationsOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1538,6 +1768,8 @@ public function testCanBeGroupOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1570,6 +1802,8 @@ public function testCanBeGroupOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1591,6 +1825,8 @@ public function testCanBeRunTestsInSeparateProcesses(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1623,6 +1859,8 @@ public function testCanBeRunTestsInSeparateProcesses(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1642,6 +1880,8 @@ public function testCanBeRunClassInSeparateProcess(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversNothing()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); @@ -1674,6 +1914,8 @@ public function testCanBeRunClassInSeparateProcess(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1693,6 +1935,8 @@ public function testCanBeRunInSeparateProcess(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversNothing()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); @@ -1725,6 +1969,8 @@ public function testCanBeRunInSeparateProcess(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1744,6 +1990,8 @@ public function testCanBeTest(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversNothing()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); @@ -1776,6 +2024,8 @@ public function testCanBeTest(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1795,6 +2045,8 @@ public function testCanBePreCondition(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1827,6 +2079,8 @@ public function testCanBePreCondition(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1846,6 +2100,8 @@ public function testCanBePostCondition(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -1878,6 +2134,8 @@ public function testCanBePostCondition(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1928,6 +2186,8 @@ public function testCanBePreserveGlobalStateOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -1980,6 +2240,8 @@ public function testCanBePreserveGlobalStateOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2001,6 +2263,8 @@ public function testCanBeRequiresMethodOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2033,6 +2297,8 @@ public function testCanBeRequiresMethodOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2055,6 +2321,8 @@ public function testCanBeRequiresMethodOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2087,6 +2355,8 @@ public function testCanBeRequiresMethodOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2109,6 +2379,8 @@ public function testCanBeRequiresFunctionOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2141,6 +2413,8 @@ public function testCanBeRequiresFunctionOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2162,6 +2436,8 @@ public function testCanBeRequiresFunctionOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2194,6 +2470,8 @@ public function testCanBeRequiresFunctionOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2215,6 +2493,8 @@ public function testCanBeRequiresOperatingSystemOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2247,6 +2527,8 @@ public function testCanBeRequiresOperatingSystemOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2268,6 +2550,8 @@ public function testCanBeRequiresOperatingSystemOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2300,6 +2584,8 @@ public function testCanBeRequiresOperatingSystemOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2321,6 +2607,8 @@ public function testCanBeRequiresOperatingSystemFamilyOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2353,6 +2641,8 @@ public function testCanBeRequiresOperatingSystemFamilyOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2374,6 +2664,8 @@ public function testCanBeRequiresOperatingSystemFamilyOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2406,6 +2698,8 @@ public function testCanBeRequiresOperatingSystemFamilyOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2432,6 +2726,8 @@ public function testCanBeRequiresPhpOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2464,6 +2760,8 @@ public function testCanBeRequiresPhpOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2490,6 +2788,8 @@ public function testCanBeRequiresPhpOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2522,6 +2822,8 @@ public function testCanBeRequiresPhpOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2543,6 +2845,8 @@ public function testCanBeRequiresPhpExtensionOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2575,6 +2879,8 @@ public function testCanBeRequiresPhpExtensionOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2606,6 +2912,8 @@ public function testCanBeRequiresPhpExtensionWithVersionOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2638,6 +2946,8 @@ public function testCanBeRequiresPhpExtensionWithVersionOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2661,6 +2971,8 @@ public function testCanBeRequiresPhpExtensionOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2693,6 +3005,8 @@ public function testCanBeRequiresPhpExtensionOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2724,6 +3038,8 @@ public function testCanBeRequiresPhpExtensionWithVersionOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2756,6 +3072,8 @@ public function testCanBeRequiresPhpExtensionWithVersionOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2784,6 +3102,8 @@ public function testCanBeRequiresPhpunitOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2816,6 +3136,8 @@ public function testCanBeRequiresPhpunitOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2837,6 +3159,8 @@ public function testCanBeRequiresPhpunitExtensionOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2869,6 +3193,8 @@ public function testCanBeRequiresPhpunitExtensionOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2895,6 +3221,8 @@ public function testCanBeRequiresPhpunitOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2927,6 +3255,8 @@ public function testCanBeRequiresPhpunitOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -2948,6 +3278,8 @@ public function testCanBeRequiresPhpunitExtensionOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -2980,6 +3312,8 @@ public function testCanBeRequiresPhpunitExtensionOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -3001,6 +3335,8 @@ public function testCanBeRequiresSettingOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -3033,6 +3369,8 @@ public function testCanBeRequiresSettingOnClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -3055,6 +3393,8 @@ public function testCanBeRequiresSettingOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -3087,6 +3427,8 @@ public function testCanBeRequiresSettingOnMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -3109,6 +3451,8 @@ public function testCanBeTestDoxOnClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -3141,6 +3485,8 @@ public function testCanBeTestDoxOnClass(): void $this->assertTrue($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -3162,6 +3508,8 @@ public function testCanBeTestDoxOnMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -3194,6 +3542,8 @@ public function testCanBeTestDoxOnMethod(): void $this->assertTrue($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -3215,6 +3565,8 @@ public function testCanBeTestWith(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -3247,6 +3599,8 @@ public function testCanBeTestWith(): void $this->assertFalse($metadata->isTestDox()); $this->assertTrue($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -3270,6 +3624,8 @@ public function testCanBeUsesClass(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -3302,6 +3658,8 @@ public function testCanBeUsesClass(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertTrue($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -3313,6 +3671,120 @@ public function testCanBeUsesClass(): void $this->assertFalse($metadata->isMethodLevel()); } + public function testCanBeUsesClassesThatExtendClass(): void + { + $metadata = Metadata::usesClassesThatExtendClass(self::class); + + $this->assertFalse($metadata->isAfter()); + $this->assertFalse($metadata->isAfterClass()); + $this->assertFalse($metadata->isBackupGlobals()); + $this->assertFalse($metadata->isBackupStaticProperties()); + $this->assertFalse($metadata->isBeforeClass()); + $this->assertFalse($metadata->isBefore()); + $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); + $this->assertFalse($metadata->isCoversFunction()); + $this->assertFalse($metadata->isCoversMethod()); + $this->assertFalse($metadata->isCoversNothing()); + $this->assertFalse($metadata->isDataProvider()); + $this->assertFalse($metadata->isDependsOnClass()); + $this->assertFalse($metadata->isDependsOnMethod()); + $this->assertFalse($metadata->isDisableReturnValueGenerationForTestDoubles()); + $this->assertFalse($metadata->isDoesNotPerformAssertions()); + $this->assertFalse($metadata->isExcludeGlobalVariableFromBackup()); + $this->assertFalse($metadata->isExcludeStaticPropertyFromBackup()); + $this->assertFalse($metadata->isGroup()); + $this->assertFalse($metadata->isIgnoreDeprecations()); + $this->assertFalse($metadata->isIgnorePhpunitDeprecations()); + $this->assertFalse($metadata->isRunClassInSeparateProcess()); + $this->assertFalse($metadata->isRunInSeparateProcess()); + $this->assertFalse($metadata->isRunTestsInSeparateProcesses()); + $this->assertFalse($metadata->isTest()); + $this->assertFalse($metadata->isPreCondition()); + $this->assertFalse($metadata->isPostCondition()); + $this->assertFalse($metadata->isPreserveGlobalState()); + $this->assertFalse($metadata->isRequiresMethod()); + $this->assertFalse($metadata->isRequiresFunction()); + $this->assertFalse($metadata->isRequiresOperatingSystem()); + $this->assertFalse($metadata->isRequiresOperatingSystemFamily()); + $this->assertFalse($metadata->isRequiresPhp()); + $this->assertFalse($metadata->isRequiresPhpExtension()); + $this->assertFalse($metadata->isRequiresPhpunit()); + $this->assertFalse($metadata->isRequiresPhpunitExtension()); + $this->assertFalse($metadata->isRequiresSetting()); + $this->assertFalse($metadata->isTestDox()); + $this->assertFalse($metadata->isTestWith()); + $this->assertFalse($metadata->isUsesClass()); + $this->assertTrue($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); + $this->assertFalse($metadata->isUsesFunction()); + $this->assertFalse($metadata->isUsesMethod()); + $this->assertFalse($metadata->isWithoutErrorHandler()); + + $this->assertSame(self::class, $metadata->className()); + + $this->assertTrue($metadata->isClassLevel()); + $this->assertFalse($metadata->isMethodLevel()); + } + + public function testCanBeUsesClassesThatImplementInterface(): void + { + $metadata = Metadata::usesClassesThatImplementInterface(self::class); + + $this->assertFalse($metadata->isAfter()); + $this->assertFalse($metadata->isAfterClass()); + $this->assertFalse($metadata->isBackupGlobals()); + $this->assertFalse($metadata->isBackupStaticProperties()); + $this->assertFalse($metadata->isBeforeClass()); + $this->assertFalse($metadata->isBefore()); + $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); + $this->assertFalse($metadata->isCoversFunction()); + $this->assertFalse($metadata->isCoversMethod()); + $this->assertFalse($metadata->isCoversNothing()); + $this->assertFalse($metadata->isDataProvider()); + $this->assertFalse($metadata->isDependsOnClass()); + $this->assertFalse($metadata->isDependsOnMethod()); + $this->assertFalse($metadata->isDisableReturnValueGenerationForTestDoubles()); + $this->assertFalse($metadata->isDoesNotPerformAssertions()); + $this->assertFalse($metadata->isExcludeGlobalVariableFromBackup()); + $this->assertFalse($metadata->isExcludeStaticPropertyFromBackup()); + $this->assertFalse($metadata->isGroup()); + $this->assertFalse($metadata->isIgnoreDeprecations()); + $this->assertFalse($metadata->isIgnorePhpunitDeprecations()); + $this->assertFalse($metadata->isRunClassInSeparateProcess()); + $this->assertFalse($metadata->isRunInSeparateProcess()); + $this->assertFalse($metadata->isRunTestsInSeparateProcesses()); + $this->assertFalse($metadata->isTest()); + $this->assertFalse($metadata->isPreCondition()); + $this->assertFalse($metadata->isPostCondition()); + $this->assertFalse($metadata->isPreserveGlobalState()); + $this->assertFalse($metadata->isRequiresMethod()); + $this->assertFalse($metadata->isRequiresFunction()); + $this->assertFalse($metadata->isRequiresOperatingSystem()); + $this->assertFalse($metadata->isRequiresOperatingSystemFamily()); + $this->assertFalse($metadata->isRequiresPhp()); + $this->assertFalse($metadata->isRequiresPhpExtension()); + $this->assertFalse($metadata->isRequiresPhpunit()); + $this->assertFalse($metadata->isRequiresPhpunitExtension()); + $this->assertFalse($metadata->isRequiresSetting()); + $this->assertFalse($metadata->isTestDox()); + $this->assertFalse($metadata->isTestWith()); + $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertTrue($metadata->isUsesClassesThatImplementInterface()); + $this->assertFalse($metadata->isUsesFunction()); + $this->assertFalse($metadata->isUsesMethod()); + $this->assertFalse($metadata->isWithoutErrorHandler()); + + $this->assertSame(self::class, $metadata->interfaceName()); + + $this->assertTrue($metadata->isClassLevel()); + $this->assertFalse($metadata->isMethodLevel()); + } + public function testCanBeUsesFunction(): void { $metadata = Metadata::usesFunction('f'); @@ -3324,6 +3796,8 @@ public function testCanBeUsesFunction(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -3356,6 +3830,8 @@ public function testCanBeUsesFunction(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertTrue($metadata->isUsesFunction()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -3377,6 +3853,8 @@ public function testCanBeUsesMethod(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -3409,6 +3887,8 @@ public function testCanBeUsesMethod(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertTrue($metadata->isUsesMethod()); $this->assertFalse($metadata->isWithoutErrorHandler()); @@ -3432,6 +3912,8 @@ public function testCanBeWithoutErrorHandler(): void $this->assertFalse($metadata->isBeforeClass()); $this->assertFalse($metadata->isBefore()); $this->assertFalse($metadata->isCoversClass()); + $this->assertFalse($metadata->isCoversClassesThatExtendClass()); + $this->assertFalse($metadata->isCoversClassesThatImplementInterface()); $this->assertFalse($metadata->isCoversFunction()); $this->assertFalse($metadata->isCoversMethod()); $this->assertFalse($metadata->isCoversNothing()); @@ -3464,6 +3946,8 @@ public function testCanBeWithoutErrorHandler(): void $this->assertFalse($metadata->isTestDox()); $this->assertFalse($metadata->isTestWith()); $this->assertFalse($metadata->isUsesClass()); + $this->assertFalse($metadata->isUsesClassesThatExtendClass()); + $this->assertFalse($metadata->isUsesClassesThatImplementInterface()); $this->assertFalse($metadata->isUsesFunction()); $this->assertFalse($metadata->isUsesMethod()); $this->assertTrue($metadata->isWithoutErrorHandler()); diff --git a/tests/unit/Metadata/Parser/AttributeParserTestCase.php b/tests/unit/Metadata/Parser/AttributeParserTestCase.php index 48fc2b38a86..3c351fd2ca8 100644 --- a/tests/unit/Metadata/Parser/AttributeParserTestCase.php +++ b/tests/unit/Metadata/Parser/AttributeParserTestCase.php @@ -87,6 +87,26 @@ public function test_parses_CoversClass_attribute_on_class(): void $this->assertSame(Example::class, $metadata->asArray()[0]->className()); } + #[TestDox('Parses #[CoversClassesThatExtendClass] attribute on class')] + public function test_parses_CoversClassesThatExtendClass_attribute_on_class(): void + { + $metadata = $this->parser()->forClass(CoversTest::class)->isCoversClassesThatExtendClass(); + + $this->assertCount(1, $metadata); + $this->assertTrue($metadata->asArray()[0]->isCoversClassesThatExtendClass()); + $this->assertSame(Example::class, $metadata->asArray()[0]->className()); + } + + #[TestDox('Parses #[CoversClassesThatImplementInterface] attribute on class')] + public function test_parses_CoversClassesThatImplementInterface_attribute_on_class(): void + { + $metadata = $this->parser()->forClass(CoversTest::class)->isCoversClassesThatImplementInterface(); + + $this->assertCount(1, $metadata); + $this->assertTrue($metadata->asArray()[0]->isCoversClassesThatImplementInterface()); + $this->assertSame(Example::class, $metadata->asArray()[0]->interfaceName()); + } + #[TestDox('Parses #[CoversFunction] attribute on class')] public function test_parses_CoversFunction_attribute_on_class(): void { @@ -398,6 +418,26 @@ public function test_parses_UsesClass_attribute_on_class(): void $this->assertSame(Example::class, $metadata->asArray()[0]->className()); } + #[TestDox('Parses #[UsesClassesThatExtendClass] attribute on class')] + public function test_parses_UsesClassesThatExtendClass_attribute_on_class(): void + { + $metadata = $this->parser()->forClass(UsesTest::class)->isUsesClassesThatExtendClass(); + + $this->assertCount(1, $metadata); + $this->assertTrue($metadata->asArray()[0]->isUsesClassesThatExtendClass()); + $this->assertSame(Example::class, $metadata->asArray()[0]->className()); + } + + #[TestDox('Parses #[UsesClassesThatImplementInterface] attribute on class')] + public function test_parses_UsesClassesThatImplementInterface_attribute_on_class(): void + { + $metadata = $this->parser()->forClass(UsesTest::class)->isUsesClassesThatImplementInterface(); + + $this->assertCount(1, $metadata); + $this->assertTrue($metadata->asArray()[0]->isUsesClassesThatImplementInterface()); + $this->assertSame(Example::class, $metadata->asArray()[0]->interfaceName()); + } + #[TestDox('Parses #[UsesFunction] attribute on class')] public function test_parses_UsesFunction_attribute_on_class(): void {