/** * 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 ::check * @covers ::checkProcessResult * @dataProvider provideResultsToTest */ public function testCanCallStatically($resultObj, $expectedResult) { // ---------------------------------------------------------------- // setup your test // ---------------------------------------------------------------- // perform the change $actualResult1 = DidProcessFail::check($resultObj); $actualResult2 = DidProcessFail::checkProcessResult($resultObj); // ---------------------------------------------------------------- // test the results $this->assertEquals($expectedResult, $actualResult1); $this->assertEquals($expectedResult, $actualResult2); }