From 11e8581b35c833de37ed3564e9ae84e6be17cc91 Mon Sep 17 00:00:00 2001 From: Raffaele Carelle Date: Tue, 24 Sep 2024 13:01:41 +0200 Subject: [PATCH] improve assertions --- tests/Functional/Filter/ExcludeTest.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/Functional/Filter/ExcludeTest.php b/tests/Functional/Filter/ExcludeTest.php index 23b8bfc7..62d9c8bd 100644 --- a/tests/Functional/Filter/ExcludeTest.php +++ b/tests/Functional/Filter/ExcludeTest.php @@ -5,6 +5,7 @@ namespace Tests\Functional\Filter; use Paraunit\Filter\Filter; +use Symfony\Component\Filesystem\Path; use Tests\BaseFunctionalTestCase; class ExcludeTest extends BaseFunctionalTestCase @@ -22,6 +23,18 @@ public function testExcludeTestSuites(): void /** @var Filter $filter */ $filter = $this->getService(Filter::class); - $this->assertCount(1, $filter->filterTestFiles()); + $files = $filter->filterTestFiles(); + + $this->assertCount(1, $files); + + $files = array_map(function (string $file): string { + return Path::makeRelative($file, dirname(__DIR__)); + }, $files); + + // Test in suite1 is in array + $this->assertTrue(in_array('../Stub/ThreeGreenTestStub.php', $files)); + + // Test in suite2 doesn't + $this->assertFalse(in_array('../Stub/EntityManagerClosedTestStub.php', $files)); } }