minor #14998 [Debug] fix debug class loader case test on windows (Tobion)

This PR was merged into the 2.6 branch.

Discussion
----------

[Debug] fix debug class loader case test on windows

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14978
| License       | MIT
| Doc PR        | none

https://github.com/symfony/symfony/blob/2.6/src/Symfony/Component/Debug/DebugClassLoader.php#L213 didn't work since $real and $tail had different directory separators.

Commits
-------

31c25d9 [Debug] fix debug class loader case test on windows
This commit is contained in:
Nicolas Grekas 2015-06-16 13:43:55 +02:00
commit 04ccdc14fe

View File

@ -130,6 +130,7 @@ class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase
/**
* @expectedException \RuntimeException
* @expectedExceptionMessage Case mismatch between class and source file names
*/
public function testFileCaseMismatch()
{
@ -177,6 +178,8 @@ class ClassLoader
public function findFile($class)
{
$fixtureDir = __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR;
if (__NAMESPACE__.'\TestingUnsilencing' === $class) {
eval('-- parse error --');
} elseif (__NAMESPACE__.'\TestingStacking' === $class) {
@ -184,13 +187,13 @@ class ClassLoader
} elseif (__NAMESPACE__.'\TestingCaseMismatch' === $class) {
eval('namespace '.__NAMESPACE__.'; class TestingCaseMisMatch {}');
} elseif (__NAMESPACE__.'\Fixtures\CaseMismatch' === $class) {
return __DIR__.'/Fixtures/CaseMismatch.php';
return $fixtureDir.'CaseMismatch.php';
} elseif (__NAMESPACE__.'\Fixtures\Psr4CaseMismatch' === $class) {
return __DIR__.'/Fixtures/psr4/Psr4CaseMismatch.php';
return $fixtureDir.'psr4'.DIRECTORY_SEPARATOR.'Psr4CaseMismatch.php';
} elseif (__NAMESPACE__.'\Fixtures\NotPSR0' === $class) {
return __DIR__.'/Fixtures/reallyNotPsr0.php';
return $fixtureDir.'reallyNotPsr0.php';
} elseif (__NAMESPACE__.'\Fixtures\NotPSR0bis' === $class) {
return __DIR__.'/Fixtures/notPsr0Bis.php';
return $fixtureDir.'notPsr0Bis.php';
}
}
}