You are here

public function AbstractProcessTest::testCallbackIsExecutedForOutput in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/process/Tests/AbstractProcessTest.php \Symfony\Component\Process\Tests\AbstractProcessTest::testCallbackIsExecutedForOutput()

File

vendor/symfony/process/Tests/AbstractProcessTest.php, line 289

Class

AbstractProcessTest
@author Robert Schönthal <seroscho@googlemail.com>

Namespace

Symfony\Component\Process\Tests

Code

public function testCallbackIsExecutedForOutput() {
  $p = $this
    ->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('echo \'foo\';')));
  $called = false;
  $p
    ->run(function ($type, $buffer) use (&$called) {
    $called = $buffer === 'foo';
  });
  $this
    ->assertTrue($called, 'The callback should be executed with the output');
}