mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Merge branches 'add_exclude' and 'master' of https://github.com/trivago/composer into add_exclude
* Resolve conflicts and update unit test
This commit is contained in:
parent
f28785a49d
commit
dad6b05ca7
3 changed files with 24 additions and 29 deletions
|
@ -1200,6 +1200,11 @@ EOF;
|
|||
$package->setAutoload(array(
|
||||
'psr-0' => array(
|
||||
'Main' => 'src/',
|
||||
'Lala' => array('src/', 'lib/'),
|
||||
),
|
||||
'psr-4' => array(
|
||||
'Acme\Fruit\\' => 'src-fruit/',
|
||||
'Acme\Cake\\' => array('src-cake/', 'lib-cake/'),
|
||||
),
|
||||
'classmap' => array('composersrc/'),
|
||||
'exclude-from-classmap' => array('/tests/'),
|
||||
|
@ -1210,17 +1215,25 @@ EOF;
|
|||
->will($this->returnValue(array()));
|
||||
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/composer');
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/src');
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/src/Lala');
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/lib');
|
||||
file_put_contents($this->workingDir.'/src/Lala/ClassMapMain.php', '<?php namespace Lala; class ClassMapMain {}');
|
||||
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/src-fruit');
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/src-cake');
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/lib-cake');
|
||||
file_put_contents($this->workingDir.'/src-cake/ClassMapBar.php', '<?php namespace Acme\Cake; class ClassMapBar {}');
|
||||
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/composersrc');
|
||||
file_put_contents($this->workingDir.'/composersrc/foo.php', '<?php class ClassMapFoo {}');
|
||||
|
||||
// this class should not be found in the classmap
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/composersrc/tests');
|
||||
file_put_contents($this->workingDir.'/composersrc/tests/bar.php', '<?php class ClassExcludeMapFoo {}');
|
||||
|
||||
$this->generator->dump($this->config, $this->repository, $package, $this->im, 'composer', false, '_1');
|
||||
$this->generator->dump($this->config, $this->repository, $package, $this->im, 'composer', true, '_1');
|
||||
|
||||
// Assert that autoload_classmap.php was correctly generated.
|
||||
// Assert that autoload_classmap.php was correctly generated.
|
||||
$this->assertAutoloadFiles('classmap', $this->vendorDir.'/composer', 'classmap');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue