Skip to content

Commit

Permalink
Test(web-twig): Use real paths in data provider for Compiler Pass
Browse files Browse the repository at this point in the history
  * paths are added using `glob` function which do not work with
    unexisting paths
  • Loading branch information
literat committed Aug 12, 2022
1 parent a65866c commit 2c81c5a
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,21 @@ public function testShouldRegisterTwigPaths(array $paths, int $expectedCalls): v
*/
public function registerTwigPathsDataProvider(): array
{
$realPath = realpath(__DIR__ . '/../../../src/DependencyInjection') . '/../Resources/components';
$defaultPath = realpath(__DIR__ . '/../../../src/DependencyInjection') . '/../Resources/twig-components';

return [
'test should register default partials path which is filtered out' => [
[], 0,
],
'test should register random one path' => [
['dir1/'], 1,
[$realPath . '/Alert/'], 1,
],
'test should register random multiple paths' => [
['dir1/', 'dir2'], 2,
[$realPath . '/Alert/', $realPath . '/Button/'], 2,
],
'test should register paths with default' => [
['dir1/', 'dir2', $defaultPath], 3,
[$realPath . '/Alert/', $realPath . '/Button/', $defaultPath], 4,
],
];
}
Expand Down

0 comments on commit 2c81c5a

Please sign in to comment.