Skip to content

Commit

Permalink
improve assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaelecarelle committed Sep 24, 2024
1 parent caba345 commit f40a4b8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/Functional/Filter/ExcludeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Tests\Functional\Filter;

use Paraunit\Filter\Filter;
use Symfony\Component\Filesystem\Path;
use Tests\BaseFunctionalTestCase;

class ExcludeTest extends BaseFunctionalTestCase
Expand All @@ -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));
}
}

0 comments on commit f40a4b8

Please sign in to comment.