public function expectException($exception) { if (method_exists('PHPUnit_Framework_TestCase', "expectException")) { return parent::expectException($exception); } else { $this->markTestIncomplete("expectException is not available"); } }
/** * In phpunit 5.2 setExpectedException() method is deprecated. * * @param mixed $exception */ public function expectException($exception) { if ($this->phpunitSeries < 5.2) { $this->setExpectedException($exception); } else { parent::expectException($exception); } }
public function expectException($exception) { //future-proofed expectException method if (method_exists(get_parent_class(), 'expectException')) { parent::expectException($exception); } else { $this->setExpectedException($exception); } }
public function expectException($exception, $message = '', $code = null) { if (version_compare(\PHPUnit_Runner_Version::id(), '5.2') === -1) { $this->setExpectedException($exception, $message, $code); } else { parent::expectException($exception); if (!empty($message)) { parent::expectExceptionMessage($message); } if ($code !== null) { parent::expectExceptionCode($code); } } }