Skip to content

Commit 79fde10

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: Fix typo Fix deprecated libxml_disable_entity_loader 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 f8c1413 + bbfab80 commit 79fde10

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
@@ -28,7 +28,7 @@ public function testDebugMissingMessages()
2828
$tester = $this->createCommandTester(['foo' => 'foo']);
2929
$res = $tester->execute(['locale' => 'en', 'bundle' => 'foo']);
3030

31-
$this->assertRegExp('/missing/', $tester->getDisplay());
31+
$this->assertMatchesRegularExpression('/missing/', $tester->getDisplay());
3232
$this->assertEquals(TranslationDebugCommand::EXIT_CODE_MISSING, $res);
3333
}
3434

@@ -37,7 +37,7 @@ public function testDebugUnusedMessages()
3737
$tester = $this->createCommandTester([], ['foo' => 'foo']);
3838
$res = $tester->execute(['locale' => 'en', 'bundle' => 'foo']);
3939

40-
$this->assertRegExp('/unused/', $tester->getDisplay());
40+
$this->assertMatchesRegularExpression('/unused/', $tester->getDisplay());
4141
$this->assertEquals(TranslationDebugCommand::EXIT_CODE_UNUSED, $res);
4242
}
4343

@@ -46,7 +46,7 @@ public function testDebugFallbackMessages()
4646
$tester = $this->createCommandTester(['foo' => 'foo'], ['foo' => 'foo']);
4747
$res = $tester->execute(['locale' => 'fr', 'bundle' => 'foo']);
4848

49-
$this->assertRegExp('/fallback/', $tester->getDisplay());
49+
$this->assertMatchesRegularExpression('/fallback/', $tester->getDisplay());
5050
$this->assertEquals(TranslationDebugCommand::EXIT_CODE_FALLBACK, $res);
5151
}
5252

@@ -55,7 +55,7 @@ public function testNoDefinedMessages()
5555
$tester = $this->createCommandTester();
5656
$res = $tester->execute(['locale' => 'fr', 'bundle' => 'test']);
5757

58-
$this->assertRegExp('/No defined or extracted messages for locale "fr"/', $tester->getDisplay());
58+
$this->assertMatchesRegularExpression('/No defined or extracted messages for locale "fr"/', $tester->getDisplay());
5959
$this->assertEquals(TranslationDebugCommand::EXIT_CODE_GENERAL_ERROR, $res);
6060
}
6161

@@ -65,8 +65,8 @@ public function testDebugDefaultDirectory()
6565
$res = $tester->execute(['locale' => 'en']);
6666
$expectedExitStatus = TranslationDebugCommand::EXIT_CODE_MISSING | TranslationDebugCommand::EXIT_CODE_UNUSED;
6767

68-
$this->assertRegExp('/missing/', $tester->getDisplay());
69-
$this->assertRegExp('/unused/', $tester->getDisplay());
68+
$this->assertMatchesRegularExpression('/missing/', $tester->getDisplay());
69+
$this->assertMatchesRegularExpression('/unused/', $tester->getDisplay());
7070
$this->assertEquals($expectedExitStatus, $res);
7171
}
7272

@@ -83,8 +83,8 @@ public function testDebugDefaultRootDirectory()
8383
$tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar'], null, [$this->translationDir.'/trans'], [$this->translationDir.'/views']);
8484
$res = $tester->execute(['locale' => 'en']);
8585

86-
$this->assertRegExp('/missing/', $tester->getDisplay());
87-
$this->assertRegExp('/unused/', $tester->getDisplay());
86+
$this->assertMatchesRegularExpression('/missing/', $tester->getDisplay());
87+
$this->assertMatchesRegularExpression('/unused/', $tester->getDisplay());
8888
$this->assertEquals($expectedExitStatus, $res);
8989
}
9090

@@ -103,8 +103,8 @@ public function testDebugCustomDirectory()
103103
$tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar'], $kernel);
104104
$res = $tester->execute(['locale' => 'en', 'bundle' => $this->translationDir.'/customDir']);
105105

106-
$this->assertRegExp('/missing/', $tester->getDisplay());
107-
$this->assertRegExp('/unused/', $tester->getDisplay());
106+
$this->assertMatchesRegularExpression('/missing/', $tester->getDisplay());
107+
$this->assertMatchesRegularExpression('/unused/', $tester->getDisplay());
108108
$this->assertEquals($expectedExitStatus, $res);
109109
}
110110

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,14 +109,14 @@ 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
public function testWriteMessagesForSpecificDomain()
116116
{
117117
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo'], 'mydomain' => ['bar' => 'bar']]);
118118
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true, '--domain' => 'mydomain']);
119-
$this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay());
119+
$this->assertMatchesRegularExpression('/Translation files were successfully updated./', $tester->getDisplay());
120120
}
121121

122122
protected function setUp(): void

0 commit comments

Comments
 (0)