From f40a4b8c5fbe312979b944334bae3149bb0eb8f6 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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/Functional/Filter/ExcludeTest.php b/tests/Functional/Filter/ExcludeTest.php index 23b8bfc7..c647a279 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,16 @@ 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(fn(string $file): string => 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)); } }