예제 #1
0
파일: Task.php 프로젝트: ackintosh/snidel
 /**
  * @return  Ackintosh\Snidel\Result\Result
  */
 public function execute()
 {
     ob_start();
     $result = new Result();
     try {
         $result->setReturn(call_user_func_array($this->getCallable(), is_array($args = $this->getArgs()) ? $args : array($args)));
     } catch (\RuntimeException $e) {
         ob_get_clean();
         throw $e;
     }
     $result->setOutput(ob_get_clean());
     $result->setTask($this);
     return $result;
 }
예제 #2
0
 /**
  * @test
  */
 public function setOutput()
 {
     $result = new Result();
     $result->setOutput('foo');
     $this->assertSame('foo', $result->getOutput());
 }