From f6f7c20f36162395e231390aa212d4a052453ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Sun, 10 Sep 2023 15:21:14 +0200 Subject: [PATCH] qa: extend inherited assertion test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- tests/AssertAnnotationTest.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/AssertAnnotationTest.php b/tests/AssertAnnotationTest.php index 7bba9297f..f64101d63 100644 --- a/tests/AssertAnnotationTest.php +++ b/tests/AssertAnnotationTest.php @@ -2942,7 +2942,8 @@ class AssertAnnotationTest extends TestCase } namespace Namespace2 { - use Namespace1\AbstractSingleInstancePluginManager; + use InvalidArgumentException;use Namespace1\AbstractSingleInstancePluginManager; + use Namespace1\AbstractPluginManager; use stdClass; /** @template-extends AbstractSingleInstancePluginManager */ @@ -2951,6 +2952,14 @@ class AssertAnnotationTest extends TestCase /** @var class-string */ protected string $instanceOf = stdClass::class; } + + /** @template-extends AbstractPluginManager */ + final class Ooq extends AbstractPluginManager + { + public function validate(mixed $value): void + { + } + } } namespace { @@ -2959,10 +2968,16 @@ class AssertAnnotationTest extends TestCase /** @var mixed $object */ $object = null; $baz->validate($object); + + $ooq = new \Namespace2\Ooq(function (): void {}); + /** @var mixed $callable */ + $callable = null; + $ooq->validate($callable); } ', 'assertions' => [ '$object===' => 'stdClass', + '$callable===' => 'callable', ], 'ignored_issues' => [], 'php_version' => '8.1',