|
|
@ -14,6 +14,8 @@ namespace Composer\Test\EventDispatcher;
|
|
|
|
|
|
|
|
|
|
|
|
use Composer\EventDispatcher\Event;
|
|
|
|
use Composer\EventDispatcher\Event;
|
|
|
|
use Composer\Installer\InstallerEvents;
|
|
|
|
use Composer\Installer\InstallerEvents;
|
|
|
|
|
|
|
|
use Composer\Config;
|
|
|
|
|
|
|
|
use Composer\Composer;
|
|
|
|
use Composer\TestCase;
|
|
|
|
use Composer\TestCase;
|
|
|
|
use Composer\IO\BufferIO;
|
|
|
|
use Composer\IO\BufferIO;
|
|
|
|
use Composer\Script\ScriptEvents;
|
|
|
|
use Composer\Script\ScriptEvents;
|
|
|
@ -77,7 +79,7 @@ class EventDispatcherTest extends TestCase
|
|
|
|
$process = $this->getMock('Composer\Util\ProcessExecutor');
|
|
|
|
$process = $this->getMock('Composer\Util\ProcessExecutor');
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
$this->getMock('Composer\Composer'),
|
|
|
|
$this->createComposerInstance(),
|
|
|
|
$this->getMock('Composer\IO\IOInterface'),
|
|
|
|
$this->getMock('Composer\IO\IOInterface'),
|
|
|
|
$process,
|
|
|
|
$process,
|
|
|
|
))
|
|
|
|
))
|
|
|
@ -102,7 +104,7 @@ class EventDispatcherTest extends TestCase
|
|
|
|
$process = $this->getMock('Composer\Util\ProcessExecutor');
|
|
|
|
$process = $this->getMock('Composer\Util\ProcessExecutor');
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
$this->getMock('Composer\Composer'),
|
|
|
|
$this->createComposerInstance(),
|
|
|
|
$io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE),
|
|
|
|
$io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE),
|
|
|
|
$process,
|
|
|
|
$process,
|
|
|
|
))
|
|
|
|
))
|
|
|
@ -138,7 +140,7 @@ class EventDispatcherTest extends TestCase
|
|
|
|
$process = $this->getMock('Composer\Util\ProcessExecutor');
|
|
|
|
$process = $this->getMock('Composer\Util\ProcessExecutor');
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
$composer = $this->getMock('Composer\Composer'),
|
|
|
|
$composer = $this->createComposerInstance(),
|
|
|
|
$io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE),
|
|
|
|
$io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE),
|
|
|
|
$process,
|
|
|
|
$process,
|
|
|
|
))
|
|
|
|
))
|
|
|
@ -182,7 +184,7 @@ class EventDispatcherTest extends TestCase
|
|
|
|
$process = $this->getMock('Composer\Util\ProcessExecutor');
|
|
|
|
$process = $this->getMock('Composer\Util\ProcessExecutor');
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
$composer = $this->getMock('Composer\Composer'),
|
|
|
|
$composer = $this->createComposerInstance(),
|
|
|
|
$io = $this->getMock('Composer\IO\IOInterface'),
|
|
|
|
$io = $this->getMock('Composer\IO\IOInterface'),
|
|
|
|
$process,
|
|
|
|
$process,
|
|
|
|
))
|
|
|
|
))
|
|
|
@ -210,7 +212,7 @@ class EventDispatcherTest extends TestCase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
$this->getMock('Composer\Composer'),
|
|
|
|
$this->createComposerInstance(),
|
|
|
|
$io,
|
|
|
|
$io,
|
|
|
|
))
|
|
|
|
))
|
|
|
|
->setMethods(array('getListeners'))
|
|
|
|
->setMethods(array('getListeners'))
|
|
|
@ -236,7 +238,7 @@ class EventDispatcherTest extends TestCase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
$this->getMock('Composer\Composer'),
|
|
|
|
$this->createComposerInstance(),
|
|
|
|
$io = $this->getMock('Composer\IO\IOInterface'),
|
|
|
|
$io = $this->getMock('Composer\IO\IOInterface'),
|
|
|
|
new ProcessExecutor,
|
|
|
|
new ProcessExecutor,
|
|
|
|
))
|
|
|
|
))
|
|
|
@ -261,7 +263,7 @@ class EventDispatcherTest extends TestCase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
$this->getMock('Composer\Composer'),
|
|
|
|
$this->createComposerInstance(),
|
|
|
|
$io = $this->getMock('Composer\IO\IOInterface'),
|
|
|
|
$io = $this->getMock('Composer\IO\IOInterface'),
|
|
|
|
new ProcessExecutor,
|
|
|
|
new ProcessExecutor,
|
|
|
|
))
|
|
|
|
))
|
|
|
@ -295,7 +297,7 @@ class EventDispatcherTest extends TestCase
|
|
|
|
$process = $this->getMock('Composer\Util\ProcessExecutor');
|
|
|
|
$process = $this->getMock('Composer\Util\ProcessExecutor');
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
->setConstructorArgs(array(
|
|
|
|
$this->getMock('Composer\Composer'),
|
|
|
|
$this->createComposerInstance(),
|
|
|
|
$this->getMock('Composer\IO\IOInterface'),
|
|
|
|
$this->getMock('Composer\IO\IOInterface'),
|
|
|
|
$process,
|
|
|
|
$process,
|
|
|
|
))
|
|
|
|
))
|
|
|
@ -334,4 +336,13 @@ class EventDispatcherTest extends TestCase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private function createComposerInstance()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$composer = new Composer;
|
|
|
|
|
|
|
|
$config = new Config;
|
|
|
|
|
|
|
|
$composer->setConfig($config);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $composer;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|