Skip to content

Commit

Permalink
expectExceptionMessageRegExp() is a horrible method name
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Aug 3, 2019
1 parent 1ba2e3e commit d1199cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog-8.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ All notable changes of the PHPUnit 8.4 release series are documented in this fil

* Implemented [#3775](https://github.com/sebastianbergmann/phpunit/issues/3775): Explicit API for expecting PHP errors, warnings, and notices

### Changed

* The method `expectExceptionMessageRegExp()` is now deprecated. There is no behavioral change in this version of PHPUnit. Using this method will trigger a deprecation warning in PHPUnit 9 and in PHPUnit 10 it will be removed. Please use `expectExceptionMessageMatches()` instead.

[8.4.0]: https://github.com/sebastianbergmann/phpunit/compare/8.3...8.4.0

12 changes: 10 additions & 2 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,17 @@ public function expectExceptionMessage(string $message): void
$this->expectedExceptionMessage = $message;
}

public function expectExceptionMessageRegExp(string $messageRegExp): void
public function expectExceptionMessageMatches(string $regularExpression): void
{
$this->expectedExceptionMessageRegExp = $messageRegExp;
$this->expectedExceptionMessageRegExp = $regularExpression;
}

/**
* @deprecated Use expectExceptionMessageMatches() instead
*/
public function expectExceptionMessageRegExp(string $regularExpression): void
{
$this->expectExceptionMessageMatches($regularExpression);
}

/**
Expand Down

0 comments on commit d1199cb

Please sign in to comment.