diff --git a/src/AssertDirectory.php b/src/AssertDirectory.php index 3c97866..a4329e8 100644 --- a/src/AssertDirectory.php +++ b/src/AssertDirectory.php @@ -52,7 +52,7 @@ private static function assertDirectoryContainsContents(string $expected, string foreach ($iterator as $fileInfo) { assert($fileInfo instanceof \SplFileInfo); $expectedPathname = $fileInfo->getPathname(); - $actualPathname = $actual . explode($expected, $expectedPathname, 2)[1]; + $actualPathname = $actual . substr($expectedPathname, strlen($expected)); if ($fileInfo->isDir()) { Assert::assertDirectoryExists($actualPathname, $message);