Skip to content

Commit

Permalink
Add setExpectedException::RequestsTest_Transport_Base
Browse files Browse the repository at this point in the history
  • Loading branch information
ntwb committed Dec 12, 2017
1 parent dbcd9a5 commit cdca915
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/Transport/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,28 @@ public function setUp() {
}
protected $skip_https = false;

/**
* PHPUnit 6+ compatibility shim.
*
* @param mixed $exception
* @param string $message
* @param int|string $code
*/
public function setExpectedException( $exception, $message = '', $code = null ) {
if ( method_exists( 'PHPUnit_Framework_TestCase', 'setExpectedException' ) ) {
parent::setExpectedException( $exception, $message, $code );
} else {
$this->expectException( $exception );
if ( '' !== $message ) {
$this->expectExceptionMessage( $message );
}
if ( null !== $code ) {
$this->expectExceptionCode( $code );
}
}
}


protected function getOptions($other = array()) {
$options = array(
'transport' => $this->transport
Expand Down

0 comments on commit cdca915

Please sign in to comment.