diff --git a/tests/Reference/GenericTest.php b/tests/Reference/GenericTest.php index cf9f50ec..3a65f46e 100644 --- a/tests/Reference/GenericTest.php +++ b/tests/Reference/GenericTest.php @@ -23,6 +23,7 @@ use Bartlett\CompatInfoDb\Domain\ValueObject\Dependency; use Bartlett\CompatInfoDb\Domain\ValueObject\Extension; +use Bartlett\CompatInfoDb\Domain\ValueObject\Function_; use Composer\Semver\Semver; use PHPUnit\Framework\ExpectationFailedException; @@ -189,6 +190,12 @@ private function provideReferenceValues(array $elements, string $opt): Generator continue; } + if ($element instanceof Function_) { + $range['is_abstract'] = $element->isAbstract(); + $range['is_final'] = $element->isFinal(); + $range['is_static'] = $element->isStatic(); + } + foreach ($element->getDependencies() as $dependency) { /** @var Dependency $dependency */ $ver = $this->getPrettyVersion($dependency->getName()); @@ -815,6 +822,18 @@ public function testGetMethodsFromReference(): void $methodExists, "Class Method '$element', found in Reference, does not exists." ); + + if ($method->isStatic()) { + $this->assertTrue( + $range['is_static'], + "Class Method '$element', found in Reference, should be declared as static." + ); + } else { + $this->assertFalse( + $range['is_static'], + "Class Method '$element', found in Reference, should not be declared as static." + ); + } } else { $this->assertFalse( $methodExists,