1
0
Fork 0

Fix expected values in tests for autoloader generator

pull/1223/head
Martin Hasoň 2012-10-17 01:00:11 +02:00
parent 9869e82df7
commit b683aeb586
3 changed files with 10 additions and 9 deletions

View File

@ -322,15 +322,15 @@ class AutoloadGeneratorTest extends TestCase
{
$package = new Package('a', '1.0', '1.0');
$package->setAutoload(array('files' => array('root.php')));
$package->setRequires(array(new Link('a', 'a/foo')));
$package->setRequires(array(new Link('a', 'z/foo')));
$packages = array();
$packages[] = $a = new Package('a/foo', '1.0', '1.0');
$packages[] = $z = new Package('z/foo', '1.0', '1.0');
$packages[] = $b = new Package('b/bar', '1.0', '1.0');
$packages[] = $c = new Package('c/lorem', '1.0', '1.0');
$a->setAutoload(array('files' => array('testA.php')));
$a->setRequires(array(new Link('a/foo', 'c/lorem')));
$z->setAutoload(array('files' => array('testA.php')));
$z->setRequires(array(new Link('z/foo', 'c/lorem')));
$b->setAutoload(array('files' => array('testB.php')));
$b->setRequires(array(new Link('b/bar', 'c/lorem')));
@ -341,10 +341,10 @@ class AutoloadGeneratorTest extends TestCase
->method('getPackages')
->will($this->returnValue($packages));
$this->fs->ensureDirectoryExists($this->vendorDir . '/a/foo');
$this->fs->ensureDirectoryExists($this->vendorDir . '/z/foo');
$this->fs->ensureDirectoryExists($this->vendorDir . '/b/bar');
$this->fs->ensureDirectoryExists($this->vendorDir . '/c/lorem');
file_put_contents($this->vendorDir . '/a/foo/testA.php', '<?php function testFilesAutoloadOrderByDependency1() {}');
file_put_contents($this->vendorDir . '/z/foo/testA.php', '<?php function testFilesAutoloadOrderByDependency1() {}');
file_put_contents($this->vendorDir . '/b/bar/testB.php', '<?php function testFilesAutoloadOrderByDependency2() {}');
file_put_contents($this->vendorDir . '/c/lorem/testC.php', '<?php function testFilesAutoloadOrderByDependency3() {}');
file_put_contents($this->workingDir . '/root.php', '<?php function testFilesAutoloadOrderByDependencyRoot() {}');
@ -366,8 +366,9 @@ class AutoloadGeneratorTest extends TestCase
public function testOverrideVendorsAutoloading()
{
$package = new Package('a', '1.0', '1.0');
$package = new Package('z', '1.0', '1.0');
$package->setAutoload(array('psr-0' => array('A\\B' => $this->workingDir.'/lib')));
$package->setRequires(array(new Link('z', 'a/a')));
$packages = array();
$packages[] = $a = new Package('a/a', '1.0', '1.0');

View File

@ -6,7 +6,7 @@ $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'ClassMapBaz' => $baseDir . '/composer-test-autoload/b/b/lib/c.php',
'ClassMapFoo' => $baseDir . '/composer-test-autoload/a/a/src/a.php',
'ClassMapBar' => $baseDir . '/composer-test-autoload/b/b/src/b.php',
'ClassMapBaz' => $baseDir . '/composer-test-autoload/b/b/lib/c.php',
);

View File

@ -31,7 +31,7 @@ class ComposerAutoloaderInitFilesAutoloadOrder
$loader->register();
require $vendorDir . '/c/lorem/testC.php';
require $vendorDir . '/a/foo/testA.php';
require $vendorDir . '/z/foo/testA.php';
require $baseDir . '/root.php';
require $vendorDir . '/b/bar/testB.php';