ProcessExecutorMock.php 677 B

12345678910111213141516171819202122232425262728293031
  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\Util\ProcessExecutor;
  13. class ProcessExecutorMock extends ProcessExecutor
  14. {
  15. private $execute;
  16. public function __construct(\Closure $execute)
  17. {
  18. $this->execute = $execute;
  19. }
  20. public function execute($command, &$output = null, $cwd = null)
  21. {
  22. $execute = $this->execute;
  23. return $execute($command, $output, $cwd);
  24. }
  25. }