Skip to content

Commit

Permalink
bug #36408 [PhpUnitBridge] add PolyfillTestCaseTrait::expectException…
Browse files Browse the repository at this point in the history
…MessageMatches to provide FC with recent phpunit versions (soyuka)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | na
| License       | MIT
| Doc PR        | na

expectExceptionMessageRegExp is deprecated coming phpunit 8.5.3  see sebastianbergmann/phpunit#4133

Not sure if I need to add something else lmk.

Commits
-------

cfd5a29eaf [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions
  • Loading branch information
nicolas-grekas committed Apr 15, 2020
2 parents 0eecc8e + f4b7a7f commit 88939b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tests/Transport/Smtp/Stream/SocketStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SocketStreamTest extends TestCase
public function testSocketErrorNoConnection()
{
$this->expectException('Symfony\Component\Mailer\Exception\TransportException');
$this->expectExceptionMessageRegExp('/Connection refused|unable to connect/');
$this->expectExceptionMessageMatches('/Connection refused|unable to connect/');
$s = new SocketStream();
$s->setTimeout(0.1);
$s->setPort(9999);
Expand All @@ -29,7 +29,7 @@ public function testSocketErrorNoConnection()
public function testSocketErrorBeforeConnectError()
{
$this->expectException('Symfony\Component\Mailer\Exception\TransportException');
$this->expectExceptionMessageRegExp('/no valid certs found cafile stream|Unable to find the socket transport "ssl"/');
$this->expectExceptionMessageMatches('/no valid certs found cafile stream|Unable to find the socket transport "ssl"/');
$s = new SocketStream();
$s->setStreamOptions([
'ssl' => [
Expand Down

0 comments on commit 88939b7

Please sign in to comment.