Skip to content

Commit 2345e1c

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: stop using deprecated PHPUnit APIs
2 parents 828ce77 + 166b795 commit 2345e1c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Tests/Command/TranslationUpdateCommandTest.php

Lines changed: 7 additions & 7 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()

Tests/Console/ApplicationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,19 +209,19 @@ public function testRunOnlyWarnsOnUnregistrableCommandAtTheEnd()
209209
public function testSuggestingPackagesWithExactMatch()
210210
{
211211
$result = $this->createEventForSuggestingPackages('doctrine:fixtures', []);
212-
$this->assertRegExp('/You may be looking for a command provided by/', $result);
212+
$this->assertMatchesRegularExpression('/You may be looking for a command provided by/', $result);
213213
}
214214

215215
public function testSuggestingPackagesWithPartialMatchAndNoAlternatives()
216216
{
217217
$result = $this->createEventForSuggestingPackages('server', []);
218-
$this->assertRegExp('/You may be looking for a command provided by/', $result);
218+
$this->assertMatchesRegularExpression('/You may be looking for a command provided by/', $result);
219219
}
220220

221221
public function testSuggestingPackagesWithPartialMatchAndAlternatives()
222222
{
223223
$result = $this->createEventForSuggestingPackages('server', ['server:run']);
224-
$this->assertNotRegExp('/You may be looking for a command provided by/', $result);
224+
$this->assertDoesNotMatchRegularExpression('/You may be looking for a command provided by/', $result);
225225
}
226226

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

0 commit comments

Comments
 (0)