mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Tweaked exclude-from-classmap: windows support, normalize paths and make sure they are all package-relative and do not leak to other packages, refs #1607
This commit is contained in:
parent
084f6de24e
commit
f1b0c073ad
2 changed files with 8 additions and 16 deletions
|
@ -1274,7 +1274,7 @@ EOF;
|
|||
'Acme\Cake\\' => array('src-cake/', 'lib-cake/'),
|
||||
),
|
||||
'classmap' => array('composersrc/'),
|
||||
'exclude-from-classmap' => array('/tests/', 'Exclude.php'),
|
||||
'exclude-from-classmap' => array('/composersrc/excludedTests/', '/composersrc/ClassToExclude.php'),
|
||||
));
|
||||
|
||||
$this->repository->expects($this->once())
|
||||
|
@ -1282,9 +1282,10 @@ EOF;
|
|||
->will($this->returnValue(array()));
|
||||
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/composer');
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/src/Lala');
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/src/Lala/Test');
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/lib');
|
||||
file_put_contents($this->workingDir.'/src/Lala/ClassMapMain.php', '<?php namespace Lala; class ClassMapMain {}');
|
||||
file_put_contents($this->workingDir.'/src/Lala/Test/ClassMapMainTest.php', '<?php namespace Lala\Test; class ClassMapMainTest {}');
|
||||
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/src-fruit');
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/src-cake');
|
||||
|
@ -1296,7 +1297,8 @@ EOF;
|
|||
file_put_contents($this->workingDir.'/composersrc/foo.php', '<?php class ClassMapFoo {}');
|
||||
|
||||
// this classes should not be found in the classmap
|
||||
file_put_contents($this->workingDir.'/composersrc/tests/bar.php', '<?php class ClassExcludeMapFoo {}');
|
||||
$this->fs->ensureDirectoryExists($this->workingDir.'/composersrc/excludedTests');
|
||||
file_put_contents($this->workingDir.'/composersrc/excludedTests/bar.php', '<?php class ClassExcludeMapFoo {}');
|
||||
file_put_contents($this->workingDir.'/composersrc/ClassToExclude.php', '<?php class ClassClassToExclude {}');
|
||||
|
||||
$this->generator->dump($this->config, $this->repository, $package, $this->im, 'composer', true, '_1');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue