InstallerEventTest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Test\Installer;
  12. use Composer\Installer\InstallerEvent;
  13. use Composer\Test\TestCase;
  14. class InstallerEventTest extends TestCase
  15. {
  16. public function testGetter()
  17. {
  18. $composer = $this->getMockBuilder('Composer\Composer')->getMock();
  19. $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
  20. $transaction = $this->getMockBuilder('Composer\DependencyResolver\LockTransaction')->disableOriginalConstructor()->getMock();
  21. $event = new InstallerEvent('EVENT_NAME', $composer, $io, true, true, $transaction);
  22. $this->assertSame('EVENT_NAME', $event->getName());
  23. $this->assertInstanceOf('Composer\Composer', $event->getComposer());
  24. $this->assertInstanceOf('Composer\IO\IOInterface', $event->getIO());
  25. $this->assertTrue($event->isDevMode());
  26. $this->assertTrue($event->isExecutingOperations());
  27. $this->assertInstanceOf('Composer\DependencyResolver\Transaction', $event->getTransaction());
  28. }
  29. }