Skip to content

Commit bbfab80

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Add Tagalog translations for validator messages 94, 95, 96 and 99 PHPUnit's assertContains() performs strict comparisons now. [ClassLoader][Routing] Fix namespace parsing on php 8. Fix deprecated libxml_disable_entity_loader Made reference to PHPUnit\Util\XML::loadfile php5-compatible. [Validator] Add missing translations for german and vietnamese Modernized deprecated PHPUnit assertion calls [Console] The message of "class not found" errors has changed in php 8. The PHPUnit\Util\XML class has been removed in PHPUnit 9.3. [Console] Make sure we pass a numeric array of arguments to call_user_func_array(). [Serializer] Fix that it will never reach DOMNode [Validator] sync translations [VarDumper] Improve previous fix on light array coloration [Cache] Fix #37667
2 parents 5cc05ef + 389cb6c commit bbfab80

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

Tests/Command/CacheClearCommand/CacheClearCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ public function testCacheIsFreshAfterCacheClearedWithWarmup()
8181

8282
$containerRef = new \ReflectionClass(require $containerFile);
8383
$containerFile = str_replace('tes_'.\DIRECTORY_SEPARATOR, 'test'.\DIRECTORY_SEPARATOR, $containerRef->getFileName());
84-
$this->assertRegExp(sprintf('/\'kernel.container_class\'\s*=>\s*\'%s\'/', $containerClass), file_get_contents($containerFile), 'kernel.container_class is properly set on the dumped container');
84+
$this->assertMatchesRegularExpression(sprintf('/\'kernel.container_class\'\s*=>\s*\'%s\'/', $containerClass), file_get_contents($containerFile), 'kernel.container_class is properly set on the dumped container');
8585
}
8686
}

Tests/Command/TranslationDebugCommandTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,40 +29,40 @@ public function testDebugMissingMessages()
2929
$tester = $this->createCommandTester(['foo' => 'foo']);
3030
$tester->execute(['locale' => 'en', 'bundle' => 'foo']);
3131

32-
$this->assertRegExp('/missing/', $tester->getDisplay());
32+
$this->assertMatchesRegularExpression('/missing/', $tester->getDisplay());
3333
}
3434

3535
public function testDebugUnusedMessages()
3636
{
3737
$tester = $this->createCommandTester([], ['foo' => 'foo']);
3838
$tester->execute(['locale' => 'en', 'bundle' => 'foo']);
3939

40-
$this->assertRegExp('/unused/', $tester->getDisplay());
40+
$this->assertMatchesRegularExpression('/unused/', $tester->getDisplay());
4141
}
4242

4343
public function testDebugFallbackMessages()
4444
{
4545
$tester = $this->createCommandTester([], ['foo' => 'foo']);
4646
$tester->execute(['locale' => 'fr', 'bundle' => 'foo']);
4747

48-
$this->assertRegExp('/fallback/', $tester->getDisplay());
48+
$this->assertMatchesRegularExpression('/fallback/', $tester->getDisplay());
4949
}
5050

5151
public function testNoDefinedMessages()
5252
{
5353
$tester = $this->createCommandTester();
5454
$tester->execute(['locale' => 'fr', 'bundle' => 'test']);
5555

56-
$this->assertRegExp('/No defined or extracted messages for locale "fr"/', $tester->getDisplay());
56+
$this->assertMatchesRegularExpression('/No defined or extracted messages for locale "fr"/', $tester->getDisplay());
5757
}
5858

5959
public function testDebugDefaultDirectory()
6060
{
6161
$tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar']);
6262
$tester->execute(['locale' => 'en']);
6363

64-
$this->assertRegExp('/missing/', $tester->getDisplay());
65-
$this->assertRegExp('/unused/', $tester->getDisplay());
64+
$this->assertMatchesRegularExpression('/missing/', $tester->getDisplay());
65+
$this->assertMatchesRegularExpression('/unused/', $tester->getDisplay());
6666
}
6767

6868
/**
@@ -93,8 +93,8 @@ public function testDebugDefaultRootDirectory()
9393
$tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar'], null, [$this->translationDir.'/trans'], [$this->translationDir.'/views']);
9494
$tester->execute(['locale' => 'en']);
9595

96-
$this->assertRegExp('/missing/', $tester->getDisplay());
97-
$this->assertRegExp('/unused/', $tester->getDisplay());
96+
$this->assertMatchesRegularExpression('/missing/', $tester->getDisplay());
97+
$this->assertMatchesRegularExpression('/unused/', $tester->getDisplay());
9898
}
9999

100100
public function testDebugCustomDirectory()
@@ -110,8 +110,8 @@ public function testDebugCustomDirectory()
110110
$tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar'], $kernel);
111111
$tester->execute(['locale' => 'en', 'bundle' => $this->translationDir.'/customDir']);
112112

113-
$this->assertRegExp('/missing/', $tester->getDisplay());
114-
$this->assertRegExp('/unused/', $tester->getDisplay());
113+
$this->assertMatchesRegularExpression('/missing/', $tester->getDisplay());
114+
$this->assertMatchesRegularExpression('/unused/', $tester->getDisplay());
115115
}
116116

117117
public function testDebugInvalidDirectory()

Tests/Command/TranslationUpdateCommandTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public function testDumpMessagesAndClean()
2828
{
2929
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]);
3030
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true]);
31-
$this->assertRegExp('/foo/', $tester->getDisplay());
32-
$this->assertRegExp('/1 message was successfully extracted/', $tester->getDisplay());
31+
$this->assertMatchesRegularExpression('/foo/', $tester->getDisplay());
32+
$this->assertMatchesRegularExpression('/1 message was successfully extracted/', $tester->getDisplay());
3333
}
3434

3535
public function testDumpSortedMessagesAndClean()
@@ -72,32 +72,32 @@ public function testDumpMessagesAndCleanInRootDirectory()
7272

7373
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo']], [], null, [$this->translationDir.'/trans'], [$this->translationDir.'/views']);
7474
$tester->execute(['command' => 'translation:update', 'locale' => 'en', '--dump-messages' => true, '--clean' => true]);
75-
$this->assertRegExp('/foo/', $tester->getDisplay());
76-
$this->assertRegExp('/1 message was successfully extracted/', $tester->getDisplay());
75+
$this->assertMatchesRegularExpression('/foo/', $tester->getDisplay());
76+
$this->assertMatchesRegularExpression('/1 message was successfully extracted/', $tester->getDisplay());
7777
}
7878

7979
public function testDumpTwoMessagesAndClean()
8080
{
8181
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo', 'bar' => 'bar']]);
8282
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true]);
83-
$this->assertRegExp('/foo/', $tester->getDisplay());
84-
$this->assertRegExp('/bar/', $tester->getDisplay());
85-
$this->assertRegExp('/2 messages were successfully extracted/', $tester->getDisplay());
83+
$this->assertMatchesRegularExpression('/foo/', $tester->getDisplay());
84+
$this->assertMatchesRegularExpression('/bar/', $tester->getDisplay());
85+
$this->assertMatchesRegularExpression('/2 messages were successfully extracted/', $tester->getDisplay());
8686
}
8787

8888
public function testDumpMessagesForSpecificDomain()
8989
{
9090
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo'], 'mydomain' => ['bar' => 'bar']]);
9191
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true, '--domain' => 'mydomain']);
92-
$this->assertRegExp('/bar/', $tester->getDisplay());
93-
$this->assertRegExp('/1 message was successfully extracted/', $tester->getDisplay());
92+
$this->assertMatchesRegularExpression('/bar/', $tester->getDisplay());
93+
$this->assertMatchesRegularExpression('/1 message was successfully extracted/', $tester->getDisplay());
9494
}
9595

9696
public function testWriteMessages()
9797
{
9898
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]);
9999
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true]);
100-
$this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay());
100+
$this->assertMatchesRegularExpression('/Translation files were successfully updated./', $tester->getDisplay());
101101
}
102102

103103
public function testWriteMessagesInRootDirectory()
@@ -109,7 +109,7 @@ public function testWriteMessagesInRootDirectory()
109109

110110
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]);
111111
$tester->execute(['command' => 'translation:update', 'locale' => 'en', '--force' => true]);
112-
$this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay());
112+
$this->assertMatchesRegularExpression('/Translation files were successfully updated./', $tester->getDisplay());
113113
}
114114

115115
/**
@@ -133,7 +133,7 @@ public function testWriteMessagesForSpecificDomain()
133133
{
134134
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo'], 'mydomain' => ['bar' => 'bar']]);
135135
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true, '--domain' => 'mydomain']);
136-
$this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay());
136+
$this->assertMatchesRegularExpression('/Translation files were successfully updated./', $tester->getDisplay());
137137
}
138138

139139
protected function setUp(): void

0 commit comments

Comments
 (0)