コード例 #1
0
ファイル: StraceTest.php プロジェクト: Jvbzephir/php-strace
 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);
 }
コード例 #2
0
ファイル: ResultTest.php プロジェクト: Jvbzephir/php-strace
 public function testSetGetOutput()
 {
     $result = new \PhpStrace\CommandLine\Execute\Result();
     $result->setOutput($output = array('abc', 'def'));
     $this->assertEquals($output, $result->getOutput());
 }