Ejemplo 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);
 }
Ejemplo n.º 2
0
 public function testConstruct()
 {
     $result = new \PhpStrace\CommandLine\Execute\Result($returnVar = 111, $output = array('test'));
     $this->assertEquals($returnVar, $result->getReturnVar());
     $this->assertEquals($output, $result->getOutput());
 }