From 2c81c5a08536b7bd9f8c7012aab307efc278076c Mon Sep 17 00:00:00 2001 From: literat Date: Thu, 11 Aug 2022 22:36:48 +0200 Subject: [PATCH] Test(web-twig): Use real paths in data provider for Compiler Pass * paths are added using `glob` function which do not work with unexisting paths --- .../CompilerPass/OverrideServiceCompilerPassTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/web-twig/tests/DependencyInjection/CompilerPass/OverrideServiceCompilerPassTest.php b/packages/web-twig/tests/DependencyInjection/CompilerPass/OverrideServiceCompilerPassTest.php index 640606d25d..cc09ac5233 100644 --- a/packages/web-twig/tests/DependencyInjection/CompilerPass/OverrideServiceCompilerPassTest.php +++ b/packages/web-twig/tests/DependencyInjection/CompilerPass/OverrideServiceCompilerPassTest.php @@ -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, ], ]; }