Skip to content

Commit a1be26b

Browse files
committed
stop using deprecated PHPUnit APIs
1 parent 83956b6 commit a1be26b

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

Tests/Command/TranslationDebugCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public function testDebugLegacyDefaultDirectory()
7878
$tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar']);
7979
$tester->execute(['locale' => 'en']);
8080

81-
$this->assertRegExp('/missing/', $tester->getDisplay());
82-
$this->assertRegExp('/unused/', $tester->getDisplay());
81+
$this->assertMatchesRegularExpression('/missing/', $tester->getDisplay());
82+
$this->assertMatchesRegularExpression('/unused/', $tester->getDisplay());
8383
}
8484

8585
public function testDebugDefaultRootDirectory()

Tests/Command/TranslationUpdateCommandTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,31 @@ public function testDumpSortedMessagesAndClean()
3636
{
3737
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo', 'test' => 'test', 'bar' => 'bar']]);
3838
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true, '--sort' => 'asc']);
39-
$this->assertRegExp("/\*bar\*foo\*test/", preg_replace('/\s+/', '', $tester->getDisplay()));
40-
$this->assertRegExp('/3 messages were successfully extracted/', $tester->getDisplay());
39+
$this->assertMatchesRegularExpression("/\*bar\*foo\*test/", preg_replace('/\s+/', '', $tester->getDisplay()));
40+
$this->assertMatchesRegularExpression('/3 messages were successfully extracted/', $tester->getDisplay());
4141
}
4242

4343
public function testDumpReverseSortedMessagesAndClean()
4444
{
4545
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo', 'test' => 'test', 'bar' => 'bar']]);
4646
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true, '--sort' => 'desc']);
47-
$this->assertRegExp("/\*test\*foo\*bar/", preg_replace('/\s+/', '', $tester->getDisplay()));
48-
$this->assertRegExp('/3 messages were successfully extracted/', $tester->getDisplay());
47+
$this->assertMatchesRegularExpression("/\*test\*foo\*bar/", preg_replace('/\s+/', '', $tester->getDisplay()));
48+
$this->assertMatchesRegularExpression('/3 messages were successfully extracted/', $tester->getDisplay());
4949
}
5050

5151
public function testDumpSortWithoutValueAndClean()
5252
{
5353
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo', 'test' => 'test', 'bar' => 'bar']]);
5454
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true, '--sort']);
55-
$this->assertRegExp("/\*bar\*foo\*test/", preg_replace('/\s+/', '', $tester->getDisplay()));
56-
$this->assertRegExp('/3 messages were successfully extracted/', $tester->getDisplay());
55+
$this->assertMatchesRegularExpression("/\*bar\*foo\*test/", preg_replace('/\s+/', '', $tester->getDisplay()));
56+
$this->assertMatchesRegularExpression('/3 messages were successfully extracted/', $tester->getDisplay());
5757
}
5858

5959
public function testDumpWrongSortAndClean()
6060
{
6161
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo', 'test' => 'test', 'bar' => 'bar']]);
6262
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true, '--sort' => 'test']);
63-
$this->assertRegExp('/\[ERROR\] Wrong sort order/', $tester->getDisplay());
63+
$this->assertMatchesRegularExpression('/\[ERROR\] Wrong sort order/', $tester->getDisplay());
6464
}
6565

6666
public function testDumpMessagesAndCleanInRootDirectory()
@@ -126,7 +126,7 @@ public function testWriteMessagesInLegacyRootDirectory()
126126

127127
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]);
128128
$tester->execute(['command' => 'translation:update', 'locale' => 'en', '--force' => true]);
129-
$this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay());
129+
$this->assertMatchesRegularExpression('/Translation files were successfully updated./', $tester->getDisplay());
130130
}
131131

132132
public function testWriteMessagesForSpecificDomain()

Tests/Console/ApplicationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,19 @@ public function testRunOnlyWarnsOnUnregistrableCommandAtTheEnd()
232232
public function testSuggestingPackagesWithExactMatch()
233233
{
234234
$result = $this->createEventForSuggestingPackages('server:dump', []);
235-
$this->assertRegExp('/You may be looking for a command provided by/', $result);
235+
$this->assertMatchesRegularExpression('/You may be looking for a command provided by/', $result);
236236
}
237237

238238
public function testSuggestingPackagesWithPartialMatchAndNoAlternatives()
239239
{
240240
$result = $this->createEventForSuggestingPackages('server', []);
241-
$this->assertRegExp('/You may be looking for a command provided by/', $result);
241+
$this->assertMatchesRegularExpression('/You may be looking for a command provided by/', $result);
242242
}
243243

244244
public function testSuggestingPackagesWithPartialMatchAndAlternatives()
245245
{
246246
$result = $this->createEventForSuggestingPackages('server', ['server:run']);
247-
$this->assertNotRegExp('/You may be looking for a command provided by/', $result);
247+
$this->assertDoesNotMatchRegularExpression('/You may be looking for a command provided by/', $result);
248248
}
249249

250250
private function createEventForSuggestingPackages(string $command, array $alternatives = []): string

0 commit comments

Comments
 (0)