/** * throws exceptions if the command did not fail * * @param ProcessResult $commandResult * the result to check * @throws E4xx_ProcessSucceeded */ public static function checkProcessResult(ProcessResult $commandResult) { if (DidProcessFail::checkProcessResult($commandResult)) { return; } throw new E4xx_ProcessSucceeded($commandResult); }
/** * @covers ::checkProcessResult * @dataProvider provideResultsThatFailed */ public function testReturnsTrueIfResultCodeIsNotZero($resultObj) { // ---------------------------------------------------------------- // setup your test // ---------------------------------------------------------------- // perform the change $actualResult = DidProcessFail::check($resultObj); // ---------------------------------------------------------------- // test the results $this->assertTrue($actualResult); }