Skip to content

Commit 257b70a

Browse files
bug #36408 [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches 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
2 parents 3bbe0d7 + b10c9cb commit 257b70a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Tests/Loader/XmlFileLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ public function testLoadRouteWithControllerSetInDefaults()
439439
public function testOverrideControllerInDefaults()
440440
{
441441
$this->expectException('InvalidArgumentException');
442-
$this->expectExceptionMessageRegExp('/The routing file "[^"]*" must not specify both the "controller" attribute and the defaults key "_controller" for "app_blog"/');
442+
$this->expectExceptionMessageMatches('/The routing file "[^"]*" must not specify both the "controller" attribute and the defaults key "_controller" for "app_blog"/');
443443
$loader = new XmlFileLoader(new FileLocator([__DIR__.'/../Fixtures/controller']));
444444
$loader->load('override_defaults.xml');
445445
}
@@ -471,7 +471,7 @@ public function provideFilesImportingRoutesWithControllers()
471471
public function testImportWithOverriddenController()
472472
{
473473
$this->expectException('InvalidArgumentException');
474-
$this->expectExceptionMessageRegExp('/The routing file "[^"]*" must not specify both the "controller" attribute and the defaults key "_controller" for the "import" tag/');
474+
$this->expectExceptionMessageMatches('/The routing file "[^"]*" must not specify both the "controller" attribute and the defaults key "_controller" for the "import" tag/');
475475
$loader = new XmlFileLoader(new FileLocator([__DIR__.'/../Fixtures/controller']));
476476
$loader->load('import_override_defaults.xml');
477477
}

Tests/Loader/YamlFileLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function testLoadRouteWithControllerSetInDefaults()
144144
public function testOverrideControllerInDefaults()
145145
{
146146
$this->expectException('InvalidArgumentException');
147-
$this->expectExceptionMessageRegExp('/The routing file "[^"]*" must not specify both the "controller" key and the defaults key "_controller" for "app_blog"/');
147+
$this->expectExceptionMessageMatches('/The routing file "[^"]*" must not specify both the "controller" key and the defaults key "_controller" for "app_blog"/');
148148
$loader = new YamlFileLoader(new FileLocator([__DIR__.'/../Fixtures/controller']));
149149
$loader->load('override_defaults.yml');
150150
}
@@ -176,7 +176,7 @@ public function provideFilesImportingRoutesWithControllers()
176176
public function testImportWithOverriddenController()
177177
{
178178
$this->expectException('InvalidArgumentException');
179-
$this->expectExceptionMessageRegExp('/The routing file "[^"]*" must not specify both the "controller" key and the defaults key "_controller" for "_static"/');
179+
$this->expectExceptionMessageMatches('/The routing file "[^"]*" must not specify both the "controller" key and the defaults key "_controller" for "_static"/');
180180
$loader = new YamlFileLoader(new FileLocator([__DIR__.'/../Fixtures/controller']));
181181
$loader->load('import_override_defaults.yml');
182182
}

0 commit comments

Comments
 (0)