XdebugHandlerMock.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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\Mock;
  12. use Composer\Factory;
  13. use Composer\XdebugHandler;
  14. class XdebugHandlerMock extends XdebugHandler
  15. {
  16. public $command;
  17. public $restarted;
  18. public $output;
  19. public function __construct($loaded = null)
  20. {
  21. $this->output = Factory::createOutput();
  22. parent::__construct($this->output);
  23. $loaded = $loaded === null ? true: $loaded;
  24. $class = new \ReflectionClass(get_parent_class($this));
  25. $prop = $class->getProperty('loaded');
  26. $prop->setAccessible(true);
  27. $prop->setValue($this, $loaded);
  28. $this->command = '';
  29. $this->restarted = false;
  30. }
  31. protected function restart($command)
  32. {
  33. $this->command = $command;
  34. $this->restarted = true;
  35. }
  36. }