1
0
Fork 0

Random docblock improvements in AutoloadGeneratorTest.

pull/2666/head
Andreas Hennings 2014-01-08 00:05:24 +01:00
parent 6a9fd1dd60
commit fcf8e7f515
1 changed files with 10 additions and 0 deletions

View File

@ -511,6 +511,12 @@ class AutoloadGeneratorTest extends TestCase
$this->assertTrue(function_exists('testFilesAutoloadOrderByDependencyRoot'));
}
/**
* Test that PSR-0 and PSR-4 mappings are processed in the correct order for
* autoloading and for classmap generation:
* - The main package has priority over other packages.
* - Longer namespaces have priority over shorter namespaces.
*/
public function testOverrideVendorsAutoloading()
{
$mainPackage = new Package('z', '1.0', '1.0');
@ -542,8 +548,12 @@ class AutoloadGeneratorTest extends TestCase
$this->fs->ensureDirectoryExists($this->vendorDir.'/a/a/src');
$this->fs->ensureDirectoryExists($this->vendorDir.'/a/a/lib/A/B');
$this->fs->ensureDirectoryExists($this->vendorDir.'/b/b/src');
// Define the classes A\B\C and Foo\Bar in the main package.
file_put_contents($this->workingDir.'/lib/A/B/C.php', '<?php namespace A\\B; class C {}');
file_put_contents($this->workingDir.'/src/classes.php', '<?php namespace Foo; class Bar {}');
// Define the same two classes in the package a/a.
file_put_contents($this->vendorDir.'/a/a/lib/A/B/C.php', '<?php namespace A\\B; class C {}');
file_put_contents($this->vendorDir.'/a/a/classmap/classes.php', '<?php namespace Foo; class Bar {}');