Browse Source

minor #5368 DX: PHPUnit 9 compatibility for 2.17 (keradus)

This PR was merged into the 2.17 branch.

Discussion
----------

DX: PHPUnit 9 compatibility for 2.17

fyi @sanmai

Commits
-------

899e3c39c DX: PHPUnit 9 compatibility for 2.17
Dariusz Ruminski 4 years ago
parent
commit
7bc3a25d8e

+ 3 - 3
tests/Fixer/Phpdoc/GeneralPhpdocTagRenameFixerTest.php

@@ -204,7 +204,7 @@ final class GeneralPhpdocTagRenameFixerTest extends AbstractFixerTestCase
     public function testConfigureWithInvalidOption()
     {
         $this->expectException(InvalidFixerConfigurationException::class);
-        $this->expectExceptionMessageRegExp('/^\[general_phpdoc_tag_rename\] Invalid configuration: The option "replacements" with value true is expected to be of type "array", but is of type ".*ool.*"\.$/');
+        $this->expectExceptionMessageMatches('/^\[general_phpdoc_tag_rename\] Invalid configuration: The option "replacements" with value true is expected to be of type "array", but is of type ".*ool.*"\.$/');
 
         $this->fixer->configure([
             'replacements' => true,
@@ -214,7 +214,7 @@ final class GeneralPhpdocTagRenameFixerTest extends AbstractFixerTestCase
     public function testConfigureWithUnknownOption()
     {
         $this->expectException(InvalidFixerConfigurationException::class);
-        $this->expectExceptionMessageRegExp('/^\[general_phpdoc_tag_rename\] Invalid configuration: The option "foo" does not exist\. (Known|Defined) options are: "case_sensitive", "fix_annotation", "fix_inline", "replacements"\.$/');
+        $this->expectExceptionMessageMatches('/^\[general_phpdoc_tag_rename\] Invalid configuration: The option "foo" does not exist\. (Known|Defined) options are: "case_sensitive", "fix_annotation", "fix_inline", "replacements"\.$/');
 
         $this->fixer->configure([
             'foo' => true,
@@ -230,7 +230,7 @@ final class GeneralPhpdocTagRenameFixerTest extends AbstractFixerTestCase
     public function testConfigureWithInvalidReplacements(array $replacements, $caseSensitive, $expectedMessage)
     {
         $this->expectException(InvalidFixerConfigurationException::class);
-        $this->expectExceptionMessageRegExp(sprintf(
+        $this->expectExceptionMessageMatches(sprintf(
             '/^\[general_phpdoc_tag_rename\] Invalid configuration: %s$/',
             preg_quote($expectedMessage, '/')
         ));

+ 1 - 1
tests/Fixer/Phpdoc/PhpdocTagTypeFixerTest.php

@@ -351,7 +351,7 @@ final class PhpdocTagTypeFixerTest extends AbstractFixerTestCase
     public function testConfigureWithInvalidTagType()
     {
         $this->expectException(InvalidFixerConfigurationException::class);
-        $this->expectExceptionMessageRegExp('#^\[phpdoc_tag_type\] Invalid configuration: Unknown tag type "foo"\.#');
+        $this->expectExceptionMessageMatches('#^\[phpdoc_tag_type\] Invalid configuration: Unknown tag type "foo"\.#');
 
         $this->fixer->configure([
             'tags' => ['inheritDoc' => 'foo'],