diff -u b/core/tests/Drupal/Tests/Component/ClassFinder/ClassFinderTest.php b/core/tests/Drupal/Tests/Component/ClassFinder/ClassFinderTest.php --- b/core/tests/Drupal/Tests/Component/ClassFinder/ClassFinderTest.php +++ b/core/tests/Drupal/Tests/Component/ClassFinder/ClassFinderTest.php @@ -20,7 +20,8 @@ // The full path is returned therefore only tests with // assertStringEndsWith() so the test is portable. - $this->assertStringEndsWith('core' . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'Drupal' . DIRECTORY_SEPARATOR . 'Tests' . DIRECTORY_SEPARATOR . 'Component' . DIRECTORY_SEPARATOR . 'ClassFinder' . DIRECTORY_SEPARATOR . 'ClassFinderTest.php', $finder->findFile(ClassFinderTest::class)); + $path = str_replace('/', DIRECTORY_SEPARATOR, 'core/tests/Drupal/Tests/Component/ClassFinder/ClassFinderTest.php'); + $this->assertStringEndsWith($path, $finder->findFile(ClassFinderTest::class)); $class = 'Not\\A\\Class'; $this->assertNull($finder->findFile($class)); @@ -30,7 +31,7 @@ $loader->register(); $this->assertEquals(__FILE__, $finder->findFile($class)); // This shouldn't prevent us from finding the original file. - $this->assertStringEndsWith('core' . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'Drupal' . DIRECTORY_SEPARATOR . 'Tests' . DIRECTORY_SEPARATOR . 'Component' . DIRECTORY_SEPARATOR . 'ClassFinder' . DIRECTORY_SEPARATOR . 'ClassFinderTest.php', $finder->findFile(ClassFinderTest::class)); + $this->assertStringEndsWith($path, $finder->findFile(ClassFinderTest::class)); // Clean up the additional autoloader after the test. $loader->unregister();