Skip to content

Commit

Permalink
compatibility with PHPUnit 6.x fix
Browse files Browse the repository at this point in the history
  • Loading branch information
klimov-paul committed Apr 13, 2017
1 parent d8e6a89 commit 8269b73
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public function expectException($exception)
*/
public function expectExceptionMessage($message)
{
$parentClassMethods = get_class_methods(get_parent_class($this));
if (in_array('expectExceptionMessage', $parentClassMethods)) {
parent::expectExceptionMessage($message);
return;
}
$this->setExpectedException($this->getExpectedException(), $message);
}

Expand All @@ -33,6 +38,11 @@ public function expectExceptionMessage($message)
*/
public function expectExceptionMessageRegExp($messageRegExp)
{
$parentClassMethods = get_class_methods(get_parent_class($this));
if (in_array('expectExceptionMessageRegExp', $parentClassMethods)) {
parent::expectExceptionMessageRegExp($messageRegExp);
return;
}
$this->setExpectedExceptionRegExp($this->getExpectedException(), $messageRegExp);
}
}
Expand Down

0 comments on commit 8269b73

Please sign in to comment.