public function __construct(ProcessResult $result) { $msg = "Command '" . $result->getCommandAsString() . ' succeeded with return code ' . $result->getReturnCode(); parent::__construct(400, $msg, ['result' => $result]); }
/** * @covers ::getCommandAsString */ public function testCanGetCommandDetailsAsString() { // ---------------------------------------------------------------- // setup your test $command = ['php', '-i']; $expectedResult = "'php' '-i'"; $obj = new ProcessResult($command, 100, ''); // ---------------------------------------------------------------- // perform the change $actualResult = $obj->getCommandAsString(); // ---------------------------------------------------------------- // test the results $this->assertEquals($expectedResult, $actualResult); }