Skip to content

Commit

Permalink
minor #5368 DX: PHPUnit 9 compatibility for 2.17 (keradus)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.17 branch.

Discussion
----------

DX: PHPUnit 9 compatibility for 2.17

fyi @sanmai

Commits
-------

899e3c3 DX: PHPUnit 9 compatibility for 2.17
  • Loading branch information
keradus committed Dec 16, 2020
2 parents 6f0e10c + 899e3c3 commit 7bc3a25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/Fixer/Phpdoc/GeneralPhpdocTagRenameFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function provideFixCases()
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,
Expand All @@ -214,7 +214,7 @@ public function testConfigureWithInvalidOption()
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,
Expand All @@ -230,7 +230,7 @@ public function testConfigureWithUnknownOption()
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, '/')
));
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixer/Phpdoc/PhpdocTagTypeFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public function provideFixCases()
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'],
Expand Down

1 comment on commit 7bc3a25

@sanmai
Copy link
Contributor

@sanmai sanmai commented on 7bc3a25 Dec 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, that's about it.

Please sign in to comment.