1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Abort if a script fails to execute, and exit with the exit code of the process, fixes #1943

This commit is contained in:
Jordi Boggiano 2013-05-28 19:15:22 +02:00
parent 7449162aa4
commit 5d360ab43b
2 changed files with 10 additions and 5 deletions

View file

@ -59,7 +59,8 @@ class EventDispatcherTest extends TestCase
$process->expects($this->once())
->method('execute')
->with($command);
->with($command)
->will($this->returnValue(0));
$dispatcher->dispatchCommandEvent("post-install-cmd", false);
}
@ -80,7 +81,8 @@ class EventDispatcherTest extends TestCase
->getMock();
$process->expects($this->exactly(2))
->method('execute');
->method('execute')
->will($this->returnValue(0));
$listeners = array(
'echo -n foo',
@ -165,8 +167,9 @@ class EventDispatcherTest extends TestCase
$io->expects($this->once())
->method('write')
->with($this->equalTo('<error>Script '.$code.' handling the post-install-cmd event returned with an error: </error>'));
->with($this->equalTo('<error>Script '.$code.' handling the post-install-cmd event returned with an error</error>'));
$this->setExpectedException('RuntimeException');
$dispatcher->dispatchCommandEvent("post-install-cmd", false);
}