diff --git a/src/Type/PHPUnit/Assert/AssertMethodTypeSpecifyingExtension.php b/src/Type/PHPUnit/Assert/AssertMethodTypeSpecifyingExtension.php index 0fb0a3e..6307f24 100644 --- a/src/Type/PHPUnit/Assert/AssertMethodTypeSpecifyingExtension.php +++ b/src/Type/PHPUnit/Assert/AssertMethodTypeSpecifyingExtension.php @@ -24,7 +24,7 @@ public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void public function getClass(): string { - return 'PHPUnit\Framework\TestCase'; + return 'PHPUnit\Framework\Assert'; } public function isMethodSupported( diff --git a/tests/Type/PHPUnit/AssertMethodTypeSpecifyingExtensionTest.php b/tests/Type/PHPUnit/AssertMethodTypeSpecifyingExtensionTest.php new file mode 100644 index 0000000..6f6a1fc --- /dev/null +++ b/tests/Type/PHPUnit/AssertMethodTypeSpecifyingExtensionTest.php @@ -0,0 +1,36 @@ +gatherAssertTypes(__DIR__ . '/data/assert-method.php'); + } + + /** + * @dataProvider dataFileAsserts + * @param string $assertType + * @param string $file + * @param mixed ...$args + */ + public function testFileAsserts( + string $assertType, + string $file, + ...$args + ): void + { + $this->assertFileAsserts($assertType, $file, ...$args); + } + + public static function getAdditionalConfigFiles(): array + { + return [__DIR__ . '/../../../extension.neon']; + } + +} diff --git a/tests/Type/PHPUnit/data/assert-method.php b/tests/Type/PHPUnit/data/assert-method.php new file mode 100644 index 0000000..2f791ed --- /dev/null +++ b/tests/Type/PHPUnit/data/assert-method.php @@ -0,0 +1,17 @@ +assertNotNull($s); + assertType('string', $s); + } + +}