Fix test to reduce cross-platform issues
parent
7d7eb3b2e8
commit
b04d938319
|
@ -157,7 +157,7 @@ class EventDispatcherTest extends TestCase
|
||||||
->setMethods(array('getListeners'))
|
->setMethods(array('getListeners'))
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$code = sprintf('echo bar>&2 %s exit 1', defined('PHP_WINDOWS_VERSION_BUILD') ? '&' : ';');
|
$code = 'exit 1';
|
||||||
$listener = array($code);
|
$listener = array($code);
|
||||||
$dispatcher->expects($this->atLeastOnce())
|
$dispatcher->expects($this->atLeastOnce())
|
||||||
->method('getListeners')
|
->method('getListeners')
|
||||||
|
@ -165,11 +165,9 @@ class EventDispatcherTest extends TestCase
|
||||||
|
|
||||||
$io->expects($this->once())
|
$io->expects($this->once())
|
||||||
->method('write')
|
->method('write')
|
||||||
->with($this->equalTo('<error>Script '.$code.' handling the post-install-cmd event returned with an error: bar '.PHP_EOL.'</error>'));
|
->with($this->equalTo('<error>Script '.$code.' handling the post-install-cmd event returned with an error: </error>'));
|
||||||
|
|
||||||
ob_start();
|
|
||||||
$dispatcher->dispatchCommandEvent("post-install-cmd", false);
|
$dispatcher->dispatchCommandEvent("post-install-cmd", false);
|
||||||
$this->assertEquals('bar', trim(ob_get_clean()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function call()
|
public static function call()
|
||||||
|
|
Loading…
Reference in New Issue