1
0
Fork 0

More interesting generator tests for PSR-4.

pull/2459/head
Andreas Hennings 2013-12-22 19:58:27 +01:00
parent bda2bcac13
commit 0a4b18ce86
1 changed files with 16 additions and 10 deletions

View File

@ -725,6 +725,7 @@ EOF;
$package = new Package('a', '1.0', '1.0');
$package->setAutoload(array(
'psr-0' => array('Foo' => 'src'),
'psr-4' => array('Acme\Foo\\' => 'src-psr4'),
'classmap' => array('classmap'),
'files' => array('test.php'),
));
@ -732,6 +733,7 @@ EOF;
$vendorPackage = new Package('b/b', '1.0', '1.0');
$vendorPackage->setAutoload(array(
'psr-0' => array('Bar' => 'lib'),
'psr-4' => array('Acme\Bar\\' => 'lib-psr4'),
'classmap' => array('classmaps'),
'files' => array('bootstrap.php'),
));
@ -783,7 +785,6 @@ return array(
EOF;
// autoload_psr4.php is expected to be empty in this example.
$expectedPsr4 = <<<'EOF'
<?php
@ -793,6 +794,8 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir).'/working-dir';
return array(
'Acme\\Foo\\' => array($baseDir . '/src-psr4'),
'Acme\\Bar\\' => array($vendorDir . '/b/b/lib-psr4'),
);
EOF;
@ -830,6 +833,7 @@ EOF;
$package = new Package('a', '1.0', '1.0');
$package->setAutoload(array(
'psr-0' => array('Foo' => '../path/../src'),
'psr-4' => array('Acme\Foo\\' => '../path/../src-psr4'),
'classmap' => array('../classmap'),
'files' => array('../test.php'),
));
@ -860,7 +864,6 @@ return array(
EOF;
// autoload_psr4.php is expected to be empty in this example.
$expectedPsr4 = <<<'EOF'
<?php
@ -870,6 +873,7 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir).'/working-dir';
return array(
'Acme\\Foo\\' => array($baseDir . '/../src-psr4'),
);
EOF;
@ -900,6 +904,7 @@ EOF;
$package = new Package('a', '1.0', '1.0');
$package->setAutoload(array(
'psr-0' => array('Foo' => ''),
'psr-4' => array('Acme\Foo\\' => ''),
'classmap' => array(''),
));
@ -927,16 +932,16 @@ return array(
EOF;
// autoload_psr4.php is expected to be empty in this example.
$expectedPsr4 = <<<EOF
$expectedPsr4 = <<<'EOF'
<?php
// autoload_psr4.php @generated by Composer
\$vendorDir = dirname(dirname(__FILE__));
\$baseDir = dirname(\$vendorDir);
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Acme\\Foo\\' => array($baseDir . '/'),
);
EOF;
@ -966,6 +971,7 @@ EOF;
$package = new Package('a', '1.0', '1.0');
$package->setAutoload(array(
'psr-0' => array('Foo' => 'composer-test-autoload-src/src'),
'psr-4' => array('Acme\Foo\\' => 'composer-test-autoload-src/src-psr4'),
));
$this->repository->expects($this->once())
@ -988,16 +994,16 @@ return array(
EOF;
// autoload_psr4.php is expected to be empty in this example.
$expectedPsr4 = <<<EOF
$expectedPsr4 = <<<'EOF'
<?php
// autoload_psr4.php @generated by Composer
\$vendorDir = dirname(dirname(__FILE__));
\$baseDir = dirname(\$vendorDir);
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Acme\\Foo\\' => array($baseDir . '/composer-test-autoload-src/src-psr4'),
);
EOF;