File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,10 @@ public function getPath()
380380 } else {
381381 $ this ->path = array_map (
382382 static function ($ path ) use ($ cwd , $ filesystem ) {
383+ if ('' === $ path ) {
384+ throw new InvalidConfigurationException ('Invalid path: "". ' );
385+ }
386+
383387 $ absolutePath = $ filesystem ->isAbsolutePath ($ path )
384388 ? $ path
385389 : $ cwd .\DIRECTORY_SEPARATOR .$ path ;
Original file line number Diff line number Diff line change @@ -344,6 +344,30 @@ public function testResolvePathRelativeB()
344344 static ::assertSame ([__DIR__ ], $ resolver ->getPath ());
345345 }
346346
347+ /**
348+ * @dataProvider provideEmptyPathCases
349+ */
350+ public function testRejectInvalidPath (array $ paths )
351+ {
352+ $ resolver = $ this ->createConfigurationResolver (
353+ ['path ' => $ paths ],
354+ null ,
355+ \dirname (__DIR__ )
356+ );
357+
358+ $ this ->expectException (InvalidConfigurationException::class);
359+ $ this ->expectExceptionMessage ('Invalid path: "". ' );
360+
361+ $ resolver ->getPath ();
362+ }
363+
364+ public function provideEmptyPathCases ()
365+ {
366+ yield [['' ]];
367+ yield [[__DIR__ , '' ]];
368+ yield [['' , __DIR__ ]];
369+ }
370+
347371 public function testResolvePathWithFileThatIsExcludedDirectlyOverridePathMode ()
348372 {
349373 $ config = new Config ();
You can’t perform that action at this time.
0 commit comments