1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 08:32:56 +00:00

Merge remote-tracking branch 'ronnylt/script-event-post-dump-autoload'

Conflicts:
	tests/Composer/Test/Autoload/AutoloadGeneratorTest.php
This commit is contained in:
Jordi Boggiano 2013-02-22 18:42:29 +01:00
commit 8d55b9cced
12 changed files with 132 additions and 16 deletions

View file

@ -18,6 +18,7 @@ use Composer\Util\Filesystem;
use Composer\Package\AliasPackage;
use Composer\Package\Package;
use Composer\Test\TestCase;
use Composer\Script\ScriptEvents;
class AutoloadGeneratorTest extends TestCase
{
@ -28,6 +29,7 @@ class AutoloadGeneratorTest extends TestCase
private $repository;
private $generator;
private $fs;
private $eventDispatcher;
protected function setUp()
{
@ -69,7 +71,11 @@ class AutoloadGeneratorTest extends TestCase
}));
$this->repository = $this->getMock('Composer\Repository\RepositoryInterface');
$this->generator = new AutoloadGenerator();
$this->eventDispatcher = $this->getMockBuilder('Composer\Script\EventDispatcher')
->disableOriginalConstructor()
->getMock();
$this->generator = new AutoloadGenerator($this->eventDispatcher);
}
protected function tearDown()
@ -614,6 +620,22 @@ EOF;
$this->assertFalse(file_exists($this->vendorDir."/composer/include_paths.php"));
}
public function testEventIsDispatchedAfterAutoloadDump()
{
$this->eventDispatcher
->expects($this->once())
->method('dispatch')
->with(ScriptEvents::POST_AUTOLOAD_DUMP, false);
$package = new Package('a', '1.0', '1.0');
$package->setAutoload(array('psr-0' => array('foo/bar/non/existing/')));
$this->repository->expects($this->once())
->method('getPackages')
->will($this->returnValue(array()));
$this->generator->dump($this->config, $this->repository, $package, $this->im, 'composer', true, '_8');
}
public function testUseGlobalIncludePath()
{