Exemplo n.º 1
0
 public function testWatchOutputSegfault()
 {
     $result = new \PhpStrace\CommandLine\Execute\Result();
     $result->setReturnVar(0);
     $result->setOutput(array('some output', \PhpStrace\Strace::SIGSEGV));
     $commandLine = $this->getMock('\\PhpStrace\\CommandLine', array('stdout', 'execute'));
     $commandLine->expects($this->exactly(4))->method('stdout');
     $commandLine->expects($this->any())->method('execute')->will($this->returnValue($result));
     $commandLine->expects($this->at(3))->method('stdout')->with('some output');
     $commandLine->expects($this->at(4))->method('stdout')->with(\PhpStrace\Strace::SIGSEGV);
     $strace = new \PhpStrace\Strace($commandLine);
     $strace->watch(123456, true);
 }
Exemplo n.º 2
0
 public function testSetGetReturnVar()
 {
     $result = new \PhpStrace\CommandLine\Execute\Result();
     $result->setReturnVar($var = 1);
     $this->assertEquals($var, $result->getReturnVar());
 }