You are here

public function ProcessHelperTest::testPassedCallbackIsExecuted in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Tests/Helper/ProcessHelperTest.php \Symfony\Component\Console\Tests\Helper\ProcessHelperTest::testPassedCallbackIsExecuted()

File

vendor/symfony/console/Tests/Helper/ProcessHelperTest.php, line 34

Class

ProcessHelperTest

Namespace

Symfony\Component\Console\Tests\Helper

Code

public function testPassedCallbackIsExecuted() {
  $helper = new ProcessHelper();
  $helper
    ->setHelperSet(new HelperSet(array(
    new DebugFormatterHelper(),
  )));
  $output = $this
    ->getOutputStream(StreamOutput::VERBOSITY_NORMAL);
  $executed = false;
  $callback = function () use (&$executed) {
    $executed = true;
  };
  $helper
    ->run($output, 'php -r "echo 42;"', null, $callback);
  $this
    ->assertTrue($executed);
}