Ejemplo n.º 1
0
 /**
  *  @test
  */
 public function shouldExecuteASimpleCallableAndGetTheOutputAndReturnValueCorrectly()
 {
     $spawn = new Spawn();
     $spawn->closures(range(1, 7), function ($input) {
         echo 'this is the echo';
         $return = new \stdClass();
         $return->name = 'name';
         return $return;
     })->onCompleted(function (ClosureProcess $process) {
         $this->assertEquals('', $process->getErrorOutput());
         $this->assertEquals('name', $process->getReturnValue()->name);
         $this->assertEquals('this is the echo', $process->getOutput());
     })->start();
 }