diff --git a/composer.json b/composer.json
index 5bc6183823..565d5f298f 100644
--- a/composer.json
+++ b/composer.json
@@ -98,7 +98,7 @@
"ocramius/proxy-manager": "~0.4|~1.0|~2.0",
"predis/predis": "~1.0",
"egulias/email-validator": "~1.2,>=1.2.8|~2.0",
- "symfony/phpunit-bridge": "^3.4.31|^4.3.4|~5.0",
+ "symfony/phpunit-bridge": "^5.2",
"symfony/security-acl": "~2.8|~3.0",
"phpdocumentor/reflection-docblock": "^3.0|^4.0"
},
diff --git a/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php b/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php
index 84154512be..166f1d9c44 100644
--- a/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php
@@ -42,7 +42,7 @@ class LintCommandTest extends TestCase
$ret = $tester->execute(['filename' => [$filename]], ['decorated' => false]);
$this->assertEquals(1, $ret, 'Returns 1 in case of error');
- $this->assertRegExp('/ERROR in \S+ \(line /', trim($tester->getDisplay()));
+ $this->assertMatchesRegularExpression('/ERROR in \S+ \(line /', trim($tester->getDisplay()));
}
public function testLintFileNotReadable()
@@ -63,7 +63,7 @@ class LintCommandTest extends TestCase
$ret = $tester->execute(['filename' => [$filename]], ['decorated' => false]);
$this->assertEquals(1, $ret, 'Returns 1 in case of error');
- $this->assertRegExp('/ERROR in \S+ \(line /', trim($tester->getDisplay()));
+ $this->assertMatchesRegularExpression('/ERROR in \S+ \(line /', trim($tester->getDisplay()));
}
/**
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php
index c2cded7ab0..5168e046e5 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php
@@ -87,6 +87,6 @@ class CacheClearCommandTest extends TestCase
}
$containerRef = new \ReflectionClass(require $containerFile);
$containerFile = str_replace('tes_'.\DIRECTORY_SEPARATOR, 'test'.\DIRECTORY_SEPARATOR, $containerRef->getFileName());
- $this->assertRegExp(sprintf('/\'kernel.container_class\'\s*=>\s*\'%s\'/', $containerClass), file_get_contents($containerFile), 'kernel.container_class is properly set on the dumped container');
+ $this->assertMatchesRegularExpression(sprintf('/\'kernel.container_class\'\s*=>\s*\'%s\'/', $containerClass), file_get_contents($containerFile), 'kernel.container_class is properly set on the dumped container');
}
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php
index a4842f239a..5bc80fad4b 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php
@@ -58,7 +58,7 @@ class RouterDebugCommandTest extends TestCase
$tester->execute([]);
- $this->assertRegExp('/foo\s+ANY\s+ANY\s+ANY\s+\\/foo/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/foo\s+ANY\s+ANY\s+ANY\s+\\/foo/', $tester->getDisplay());
}
/**
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php
index b3e849b134..895c141f31 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php
@@ -28,7 +28,7 @@ class TranslationDebugCommandTest extends TestCase
$tester = $this->createCommandTester(['foo' => 'foo']);
$tester->execute(['locale' => 'en', 'bundle' => 'foo']);
- $this->assertRegExp('/missing/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/missing/', $tester->getDisplay());
}
public function testDebugUnusedMessages()
@@ -36,7 +36,7 @@ class TranslationDebugCommandTest extends TestCase
$tester = $this->createCommandTester([], ['foo' => 'foo']);
$tester->execute(['locale' => 'en', 'bundle' => 'foo']);
- $this->assertRegExp('/unused/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/unused/', $tester->getDisplay());
}
public function testDebugFallbackMessages()
@@ -44,7 +44,7 @@ class TranslationDebugCommandTest extends TestCase
$tester = $this->createCommandTester([], ['foo' => 'foo']);
$tester->execute(['locale' => 'fr', 'bundle' => 'foo']);
- $this->assertRegExp('/fallback/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/fallback/', $tester->getDisplay());
}
public function testNoDefinedMessages()
@@ -52,7 +52,7 @@ class TranslationDebugCommandTest extends TestCase
$tester = $this->createCommandTester();
$tester->execute(['locale' => 'fr', 'bundle' => 'test']);
- $this->assertRegExp('/No defined or extracted messages for locale "fr"/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/No defined or extracted messages for locale "fr"/', $tester->getDisplay());
}
public function testDebugDefaultDirectory()
@@ -60,8 +60,8 @@ class TranslationDebugCommandTest extends TestCase
$tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar']);
$tester->execute(['locale' => 'en']);
- $this->assertRegExp('/missing/', $tester->getDisplay());
- $this->assertRegExp('/unused/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/missing/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/unused/', $tester->getDisplay());
}
public function testDebugDefaultRootDirectory()
@@ -75,8 +75,8 @@ class TranslationDebugCommandTest extends TestCase
$tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar']);
$tester->execute(['locale' => 'en']);
- $this->assertRegExp('/missing/', $tester->getDisplay());
- $this->assertRegExp('/unused/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/missing/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/unused/', $tester->getDisplay());
}
public function testDebugCustomDirectory()
@@ -90,8 +90,8 @@ class TranslationDebugCommandTest extends TestCase
$tester = $this->createCommandTester(['foo' => 'foo'], ['bar' => 'bar'], $kernel);
$tester->execute(['locale' => 'en', 'bundle' => $this->translationDir]);
- $this->assertRegExp('/missing/', $tester->getDisplay());
- $this->assertRegExp('/unused/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/missing/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/unused/', $tester->getDisplay());
}
public function testDebugInvalidDirectory()
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php
index 8483f0f0da..ea3ff56dd3 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php
@@ -27,8 +27,8 @@ class TranslationUpdateCommandTest extends TestCase
{
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]);
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true]);
- $this->assertRegExp('/foo/', $tester->getDisplay());
- $this->assertRegExp('/1 message was successfully extracted/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/foo/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/1 message was successfully extracted/', $tester->getDisplay());
}
public function testDumpMessagesAndCleanInRootDirectory()
@@ -40,32 +40,32 @@ class TranslationUpdateCommandTest extends TestCase
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]);
$tester->execute(['command' => 'translation:update', 'locale' => 'en', '--dump-messages' => true, '--clean' => true]);
- $this->assertRegExp('/foo/', $tester->getDisplay());
- $this->assertRegExp('/1 message was successfully extracted/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/foo/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/1 message was successfully extracted/', $tester->getDisplay());
}
public function testDumpTwoMessagesAndClean()
{
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo', 'bar' => 'bar']]);
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true]);
- $this->assertRegExp('/foo/', $tester->getDisplay());
- $this->assertRegExp('/bar/', $tester->getDisplay());
- $this->assertRegExp('/2 messages were successfully extracted/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/foo/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/bar/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/2 messages were successfully extracted/', $tester->getDisplay());
}
public function testDumpMessagesForSpecificDomain()
{
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo'], 'mydomain' => ['bar' => 'bar']]);
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true, '--domain' => 'mydomain']);
- $this->assertRegExp('/bar/', $tester->getDisplay());
- $this->assertRegExp('/1 message was successfully extracted/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/bar/', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/1 message was successfully extracted/', $tester->getDisplay());
}
public function testWriteMessages()
{
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]);
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true]);
- $this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/Translation files were successfully updated./', $tester->getDisplay());
}
public function testWriteMessagesInRootDirectory()
@@ -77,14 +77,14 @@ class TranslationUpdateCommandTest extends TestCase
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]);
$tester->execute(['command' => 'translation:update', 'locale' => 'en', '--force' => true]);
- $this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/Translation files were successfully updated./', $tester->getDisplay());
}
public function testWriteMessagesForSpecificDomain()
{
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo'], 'mydomain' => ['bar' => 'bar']]);
$tester->execute(['command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true, '--domain' => 'mydomain']);
- $this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay());
+ $this->assertMatchesRegularExpression('/Translation files were successfully updated./', $tester->getDisplay());
}
protected function setUp()
diff --git a/src/Symfony/Bundle/WebProfilerBundle/Tests/Resources/IconTest.php b/src/Symfony/Bundle/WebProfilerBundle/Tests/Resources/IconTest.php
index c3d691d4d3..a690721ebc 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/Tests/Resources/IconTest.php
+++ b/src/Symfony/Bundle/WebProfilerBundle/Tests/Resources/IconTest.php
@@ -20,7 +20,7 @@ class IconTest extends TestCase
*/
public function testIconFileContents($iconFilePath)
{
- $this->assertRegExp('~~s', file_get_contents($iconFilePath), sprintf('The SVG metadata of the %s icon is different than expected (use the same as the other icons).', $iconFilePath));
+ $this->assertMatchesRegularExpression('~~s', file_get_contents($iconFilePath), sprintf('The SVG metadata of the %s icon is different than expected (use the same as the other icons).', $iconFilePath));
}
public function provideIconFilePaths()
diff --git a/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php b/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php
index 2aecdf8259..ffd017267a 100644
--- a/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php
+++ b/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php
@@ -81,7 +81,7 @@ class XmlUtilsTest extends TestCase
XmlUtils::loadFile($fixtures.'valid.xml', [$mock, 'validate']);
$this->fail();
} catch (\InvalidArgumentException $e) {
- $this->assertRegExp('/The XML file ".+" is not valid\./', $e->getMessage());
+ $this->assertMatchesRegularExpression('/The XML file ".+" is not valid\./', $e->getMessage());
}
$this->assertInstanceOf('DOMDocument', XmlUtils::loadFile($fixtures.'valid.xml', [$mock, 'validate']));
diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php
index b6d279875e..f813083985 100644
--- a/src/Symfony/Component/Console/Tests/ApplicationTest.php
+++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php
@@ -501,9 +501,9 @@ class ApplicationTest extends TestCase
$this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives');
} catch (\Exception $e) {
$this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
- $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
- $this->assertRegExp('/foo1:bar/', $e->getMessage());
- $this->assertRegExp('/foo:bar/', $e->getMessage());
+ $this->assertMatchesRegularExpression('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
+ $this->assertMatchesRegularExpression('/foo1:bar/', $e->getMessage());
+ $this->assertMatchesRegularExpression('/foo:bar/', $e->getMessage());
}
// Namespace + plural
@@ -512,8 +512,8 @@ class ApplicationTest extends TestCase
$this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives');
} catch (\Exception $e) {
$this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
- $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
- $this->assertRegExp('/foo1/', $e->getMessage());
+ $this->assertMatchesRegularExpression('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
+ $this->assertMatchesRegularExpression('/foo1/', $e->getMessage());
}
$application->add(new \Foo3Command());
@@ -525,8 +525,8 @@ class ApplicationTest extends TestCase
$this->fail('->find() should throw an Symfony\Component\Console\Exception\CommandNotFoundException if a command is ambiguous because of a subnamespace, with alternatives');
} catch (\Exception $e) {
$this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e);
- $this->assertRegExp('/foo3:bar/', $e->getMessage());
- $this->assertRegExp('/foo3:bar:toh/', $e->getMessage());
+ $this->assertMatchesRegularExpression('/foo3:bar/', $e->getMessage());
+ $this->assertMatchesRegularExpression('/foo3:bar:toh/', $e->getMessage());
}
}
@@ -555,10 +555,10 @@ class ApplicationTest extends TestCase
} catch (\Exception $e) {
$this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist');
$this->assertSame(['afoobar1', 'foo:bar1'], $e->getAlternatives());
- $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
- $this->assertRegExp('/afoobar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "afoobar1"');
- $this->assertRegExp('/foo:bar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "foo:bar1"');
- $this->assertNotRegExp('/foo:bar(?!1)/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, without "foo:bar" alternative');
+ $this->assertMatchesRegularExpression(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
+ $this->assertMatchesRegularExpression('/afoobar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "afoobar1"');
+ $this->assertMatchesRegularExpression('/foo:bar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "foo:bar1"');
+ $this->assertDoesNotMatchRegularExpression('/foo:bar(?!1)/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, without "foo:bar" alternative');
}
}
@@ -605,10 +605,10 @@ class ApplicationTest extends TestCase
$this->assertContains('foo', $e->getAlternatives());
$this->assertContains('foo1', $e->getAlternatives());
$this->assertContains('foo3', $e->getAlternatives());
- $this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative');
- $this->assertRegExp('/foo/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo"');
- $this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo1"');
- $this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo3"');
+ $this->assertMatchesRegularExpression('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative');
+ $this->assertMatchesRegularExpression('/foo/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo"');
+ $this->assertMatchesRegularExpression('/foo1/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo1"');
+ $this->assertMatchesRegularExpression('/foo3/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo3"');
}
}
@@ -639,7 +639,7 @@ class ApplicationTest extends TestCase
$this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command is not defined');
$this->assertSame($expectedAlternatives, $e->getAlternatives());
- $this->assertRegExp('/Command "foo" is not defined\..*Did you mean one of these\?.*/Ums', $e->getMessage());
+ $this->assertMatchesRegularExpression('/Command "foo" is not defined\..*Did you mean one of these\?.*/Ums', $e->getMessage());
}
}
@@ -721,9 +721,9 @@ class ApplicationTest extends TestCase
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
$tester->run(['command' => 'foo3:bar'], ['decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE]);
- $this->assertRegExp('/\[Exception\]\s*First exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is default and verbosity is verbose');
- $this->assertRegExp('/\[Exception\]\s*Second exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is 0 and verbosity is verbose');
- $this->assertRegExp('/\[Exception \(404\)\]\s*Third exception/', $tester->getDisplay(), '->renderException() renders a pretty exception with code exception when code exception is 404 and verbosity is verbose');
+ $this->assertMatchesRegularExpression('/\[Exception\]\s*First exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is default and verbosity is verbose');
+ $this->assertMatchesRegularExpression('/\[Exception\]\s*Second exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is 0 and verbosity is verbose');
+ $this->assertMatchesRegularExpression('/\[Exception \(404\)\]\s*Third exception/', $tester->getDisplay(), '->renderException() renders a pretty exception with code exception when code exception is 404 and verbosity is verbose');
$tester->run(['command' => 'foo3:bar'], ['decorated' => true]);
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3decorated.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions');
diff --git a/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php b/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php
index 57687d4c60..3908ca5bb2 100644
--- a/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php
+++ b/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php
@@ -23,7 +23,7 @@ class ListCommandTest extends TestCase
$commandTester = new CommandTester($command = $application->get('list'));
$commandTester->execute(['command' => $command->getName()], ['decorated' => false]);
- $this->assertRegExp('/help\s{2,}Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands');
+ $this->assertMatchesRegularExpression('/help\s{2,}Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands');
}
public function testExecuteListsCommandsWithXmlOption()
@@ -31,7 +31,7 @@ class ListCommandTest extends TestCase
$application = new Application();
$commandTester = new CommandTester($command = $application->get('list'));
$commandTester->execute(['command' => $command->getName(), '--format' => 'xml']);
- $this->assertRegExp('//', $commandTester->getDisplay(), '->execute() returns a list of available commands in XML if --xml is passed');
+ $this->assertMatchesRegularExpression('//', $commandTester->getDisplay(), '->execute() returns a list of available commands in XML if --xml is passed');
}
public function testExecuteListsCommandsWithRawOption()
diff --git a/src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php b/src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php
index 3cde54b3cd..f117759bb4 100644
--- a/src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php
+++ b/src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php
@@ -128,10 +128,10 @@ class DebugClassLoaderTest extends TestCase
// if an exception is thrown, the test passed
$this->assertStringStartsWith(__FILE__, $exception->getFile());
if (\PHP_VERSION_ID < 70000) {
- $this->assertRegExp('/^Runtime Notice: Declaration/', $exception->getMessage());
+ $this->assertMatchesRegularExpression('/^Runtime Notice: Declaration/', $exception->getMessage());
$this->assertEquals(E_STRICT, $exception->getSeverity());
} else {
- $this->assertRegExp('/^Warning: Declaration/', $exception->getMessage());
+ $this->assertMatchesRegularExpression('/^Warning: Declaration/', $exception->getMessage());
$this->assertEquals(E_WARNING, $exception->getSeverity());
}
} finally {
diff --git a/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php b/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
index 118935e769..cfd7c31122 100644
--- a/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
+++ b/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
@@ -103,10 +103,10 @@ class ErrorHandlerTest extends TestCase
// if an exception is thrown, the test passed
if (\PHP_VERSION_ID < 80000) {
$this->assertEquals(E_NOTICE, $exception->getSeverity());
- $this->assertRegExp('/^Notice: Undefined variable: (foo|bar)/', $exception->getMessage());
+ $this->assertMatchesRegularExpression('/^Notice: Undefined variable: (foo|bar)/', $exception->getMessage());
} else {
$this->assertEquals(E_WARNING, $exception->getSeverity());
- $this->assertRegExp('/^Warning: Undefined variable \$(foo|bar)/', $exception->getMessage());
+ $this->assertMatchesRegularExpression('/^Warning: Undefined variable \$(foo|bar)/', $exception->getMessage());
}
$this->assertEquals(__FILE__, $exception->getFile());
diff --git a/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php b/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php
index f356476201..d408cb43db 100644
--- a/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php
+++ b/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php
@@ -65,7 +65,7 @@ class ClassNotFoundFatalErrorHandlerTest extends TestCase
}
$this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception);
- $this->assertRegExp($translatedMessage, $exception->getMessage());
+ $this->assertMatchesRegularExpression($translatedMessage, $exception->getMessage());
$this->assertSame($error['type'], $exception->getSeverity());
$this->assertSame($error['file'], $exception->getFile());
$this->assertSame($error['line'], $exception->getLine());
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php
index d2850fcc05..3076aab290 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php
@@ -185,7 +185,7 @@ class FileLoaderTest extends TestCase
$this->assertTrue($container->has(MissingParent::class));
- $this->assertRegExp(
+ $this->assertMatchesRegularExpression(
'{Class "?Symfony\\\\Component\\\\DependencyInjection\\\\Tests\\\\Fixtures\\\\Prototype\\\\BadClasses\\\\MissingClass"? not found}',
$container->getDefinition(MissingParent::class)->getErrors()[0]
);
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php
index 5fbb387bf9..51dff733ca 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php
@@ -68,7 +68,7 @@ class XmlFileLoaderTest extends TestCase
$this->fail('->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file');
} catch (\Exception $e) {
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file');
- $this->assertRegExp(sprintf('#^Unable to parse file ".+%s": .+.$#', 'parameters.ini'), $e->getMessage(), '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file');
+ $this->assertMatchesRegularExpression(sprintf('#^Unable to parse file ".+%s": .+.$#', 'parameters.ini'), $e->getMessage(), '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file');
$e = $e->getPrevious();
$this->assertInstanceOf('InvalidArgumentException', $e, '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file');
@@ -82,7 +82,7 @@ class XmlFileLoaderTest extends TestCase
$this->fail('->parseFileToDOM() throws an InvalidArgumentException if the loaded file does not validate the XSD');
} catch (\Exception $e) {
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->parseFileToDOM() throws an InvalidArgumentException if the loaded file does not validate the XSD');
- $this->assertRegExp(sprintf('#^Unable to parse file ".+%s": .+.$#', 'nonvalid.xml'), $e->getMessage(), '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file');
+ $this->assertMatchesRegularExpression(sprintf('#^Unable to parse file ".+%s": .+.$#', 'nonvalid.xml'), $e->getMessage(), '->parseFileToDOM() throws an InvalidArgumentException if the loaded file is not a valid XML file');
$e = $e->getPrevious();
$this->assertInstanceOf('InvalidArgumentException', $e, '->parseFileToDOM() throws an InvalidArgumentException if the loaded file does not validate the XSD');
@@ -434,7 +434,7 @@ class XmlFileLoaderTest extends TestCase
$this->fail('->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
} catch (\Exception $e) {
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
- $this->assertRegExp(sprintf('#^Unable to parse file ".+%s": .+.$#', 'services3.xml'), $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
+ $this->assertMatchesRegularExpression(sprintf('#^Unable to parse file ".+%s": .+.$#', 'services3.xml'), $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
$e = $e->getPrevious();
$this->assertInstanceOf('InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
@@ -474,7 +474,7 @@ class XmlFileLoaderTest extends TestCase
$this->fail('->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
} catch (\Exception $e) {
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
- $this->assertRegExp(sprintf('#^Unable to parse file ".+%s": .+.$#', 'services7.xml'), $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
+ $this->assertMatchesRegularExpression(sprintf('#^Unable to parse file ".+%s": .+.$#', 'services7.xml'), $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
$e = $e->getPrevious();
$this->assertInstanceOf('InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
@@ -525,7 +525,7 @@ class XmlFileLoaderTest extends TestCase
$this->fail('->load() throws an InvalidArgumentException if the configuration contains a document type');
} catch (\Exception $e) {
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Exception\\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration contains a document type');
- $this->assertRegExp(sprintf('#^Unable to parse file ".+%s": .+.$#', 'withdoctype.xml'), $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration contains a document type');
+ $this->assertMatchesRegularExpression(sprintf('#^Unable to parse file ".+%s": .+.$#', 'withdoctype.xml'), $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration contains a document type');
$e = $e->getPrevious();
$this->assertInstanceOf('InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration contains a document type');
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php
index 7280357a2d..d880d07b0c 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php
@@ -566,7 +566,7 @@ class YamlFileLoaderTest extends TestCase
$this->assertCount(1, $args);
$this->assertInstanceOf(Reference::class, $args[0]);
$this->assertTrue($container->has((string) $args[0]));
- $this->assertRegExp('/^\d+_Bar~[._A-Za-z0-9]{7}$/', (string) $args[0]);
+ $this->assertMatchesRegularExpression('/^\d+_Bar~[._A-Za-z0-9]{7}$/', (string) $args[0]);
$anonymous = $container->getDefinition((string) $args[0]);
$this->assertEquals('Bar', $anonymous->getClass());
@@ -578,7 +578,7 @@ class YamlFileLoaderTest extends TestCase
$this->assertIsArray($factory);
$this->assertInstanceOf(Reference::class, $factory[0]);
$this->assertTrue($container->has((string) $factory[0]));
- $this->assertRegExp('/^\d+_Quz~[._A-Za-z0-9]{7}$/', (string) $factory[0]);
+ $this->assertMatchesRegularExpression('/^\d+_Quz~[._A-Za-z0-9]{7}$/', (string) $factory[0]);
$this->assertEquals('constructFoo', $factory[1]);
$anonymous = $container->getDefinition((string) $factory[0]);
diff --git a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
index 8ac80437fe..3f63a0570a 100644
--- a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
+++ b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
@@ -282,7 +282,7 @@ class FilesystemTest extends FilesystemTestCase
$this->filesystem->remove($basePath);
- $this->assertFileNotExists($basePath);
+ $this->assertFileDoesNotExist($basePath);
}
public function testRemoveCleansArrayOfFilesAndDirectories()
@@ -298,8 +298,8 @@ class FilesystemTest extends FilesystemTestCase
$this->filesystem->remove($files);
- $this->assertFileNotExists($basePath.'dir');
- $this->assertFileNotExists($basePath.'file');
+ $this->assertFileDoesNotExist($basePath.'dir');
+ $this->assertFileDoesNotExist($basePath.'file');
}
public function testRemoveCleansTraversableObjectOfFilesAndDirectories()
@@ -315,8 +315,8 @@ class FilesystemTest extends FilesystemTestCase
$this->filesystem->remove($files);
- $this->assertFileNotExists($basePath.'dir');
- $this->assertFileNotExists($basePath.'file');
+ $this->assertFileDoesNotExist($basePath.'dir');
+ $this->assertFileDoesNotExist($basePath.'file');
}
public function testRemoveIgnoresNonExistingFiles()
@@ -331,7 +331,7 @@ class FilesystemTest extends FilesystemTestCase
$this->filesystem->remove($files);
- $this->assertFileNotExists($basePath.'dir');
+ $this->assertFileDoesNotExist($basePath.'dir');
}
public function testRemoveCleansInvalidLinks()
@@ -355,7 +355,7 @@ class FilesystemTest extends FilesystemTestCase
$this->filesystem->remove($basePath);
- $this->assertFileNotExists($basePath);
+ $this->assertFileDoesNotExist($basePath);
}
public function testFilesExists()
@@ -753,7 +753,7 @@ class FilesystemTest extends FilesystemTestCase
$this->filesystem->rename($file, $newPath);
- $this->assertFileNotExists($file);
+ $this->assertFileDoesNotExist($file);
$this->assertFileExists($newPath);
}
@@ -779,7 +779,7 @@ class FilesystemTest extends FilesystemTestCase
$this->filesystem->rename($file, $newPath, true);
- $this->assertFileNotExists($file);
+ $this->assertFileDoesNotExist($file);
$this->assertFileExists($newPath);
}
@@ -1321,7 +1321,7 @@ class FilesystemTest extends FilesystemTestCase
$this->assertDirectoryExists($targetPath);
$this->assertFileExists($targetPath.'source');
- $this->assertFileNotExists($targetPath.'target');
+ $this->assertFileDoesNotExist($targetPath.'target');
}
public function testMirrorFromSubdirectoryInToParentDirectory()
@@ -1416,7 +1416,7 @@ class FilesystemTest extends FilesystemTestCase
$this->assertStringStartsWith($scheme, $filename);
// The php://temp stream deletes the file after close
- $this->assertFileNotExists($filename);
+ $this->assertFileDoesNotExist($filename);
}
public function testTempnamWithPharSchemeFails()
diff --git a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
index fcad11defa..31916fc7d6 100644
--- a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
+++ b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
@@ -309,7 +309,7 @@ class BinaryFileResponseTest extends ResponseTestCase
$response->prepare($request);
$response->sendContent();
- $this->assertFileNotExists($path);
+ $this->assertFileDoesNotExist($path);
}
public function testAcceptRangeOnUnsafeMethods()
diff --git a/src/Symfony/Component/HttpFoundation/Tests/File/FileTest.php b/src/Symfony/Component/HttpFoundation/Tests/File/FileTest.php
index b463aadf8c..06a4ad8b1a 100644
--- a/src/Symfony/Component/HttpFoundation/Tests/File/FileTest.php
+++ b/src/Symfony/Component/HttpFoundation/Tests/File/FileTest.php
@@ -83,7 +83,7 @@ class FileTest extends TestCase
$this->assertInstanceOf('Symfony\Component\HttpFoundation\File\File', $movedFile);
$this->assertFileExists($targetPath);
- $this->assertFileNotExists($path);
+ $this->assertFileDoesNotExist($path);
$this->assertEquals(realpath($targetPath), $movedFile->getRealPath());
@unlink($targetPath);
@@ -102,7 +102,7 @@ class FileTest extends TestCase
$movedFile = $file->move($targetDir, 'test.newname.gif');
$this->assertFileExists($targetPath);
- $this->assertFileNotExists($path);
+ $this->assertFileDoesNotExist($path);
$this->assertEquals(realpath($targetPath), $movedFile->getRealPath());
@unlink($targetPath);
@@ -137,7 +137,7 @@ class FileTest extends TestCase
$this->assertInstanceOf('Symfony\Component\HttpFoundation\File\File', $movedFile);
$this->assertFileExists($targetPath);
- $this->assertFileNotExists($path);
+ $this->assertFileDoesNotExist($path);
$this->assertEquals(realpath($targetPath), $movedFile->getRealPath());
@unlink($targetPath);
@@ -157,7 +157,7 @@ class FileTest extends TestCase
$movedFile = $file->move($targetDir);
$this->assertFileExists($targetPath);
- $this->assertFileNotExists($sourcePath);
+ $this->assertFileDoesNotExist($sourcePath);
$this->assertEquals(realpath($targetPath), $movedFile->getRealPath());
@unlink($sourcePath);
diff --git a/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php b/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php
index 2ea924bac2..4a8d2bb14a 100644
--- a/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php
+++ b/src/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php
@@ -177,7 +177,7 @@ class UploadedFileTest extends TestCase
$movedFile = $file->move(__DIR__.'/Fixtures/directory');
$this->assertFileExists($targetPath);
- $this->assertFileNotExists($path);
+ $this->assertFileDoesNotExist($path);
$this->assertEquals(realpath($targetPath), $movedFile->getRealPath());
@unlink($targetPath);
diff --git a/src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php
index 2bbf5aa1ae..47e5f8c641 100644
--- a/src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php
+++ b/src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php
@@ -20,7 +20,7 @@ class RedirectResponseTest extends TestCase
{
$response = new RedirectResponse('foo.bar');
- $this->assertRegExp('##', preg_replace('/\s+/', ' ', $response->getContent()));
+ $this->assertMatchesRegularExpression('##', preg_replace('/\s+/', ' ', $response->getContent()));
}
public function testRedirectResponseConstructorNullUrl()
diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php
index 632c96df52..028593a12a 100644
--- a/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php
+++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php
@@ -362,6 +362,6 @@ class ResponseHeaderBagTest extends TestCase
private function assertSetCookieHeader($expected, ResponseHeaderBag $actual)
{
- $this->assertRegExp('#^Set-Cookie:\s+'.preg_quote($expected, '#').'$#m', str_replace("\r\n", "\n", (string) $actual));
+ $this->assertMatchesRegularExpression('#^Set-Cookie:\s+'.preg_quote($expected, '#').'$#m', str_replace("\r\n", "\n", (string) $actual));
}
}
diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php
index a858eabe15..f2cc4fa0dd 100644
--- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php
+++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php
@@ -31,8 +31,8 @@ class ConfigDataCollectorTest extends TestCase
$this->assertTrue($c->isDebug());
$this->assertSame('config', $c->getName());
$this->assertSame('testkernel', $c->getAppName());
- $this->assertRegExp('~^'.preg_quote($c->getPhpVersion(), '~').'~', PHP_VERSION);
- $this->assertRegExp('~'.preg_quote((string) $c->getPhpVersionExtra(), '~').'$~', PHP_VERSION);
+ $this->assertMatchesRegularExpression('~^'.preg_quote($c->getPhpVersion(), '~').'~', PHP_VERSION);
+ $this->assertMatchesRegularExpression('~'.preg_quote((string) $c->getPhpVersionExtra(), '~').'$~', PHP_VERSION);
$this->assertSame(PHP_INT_SIZE * 8, $c->getPhpArchitecture());
$this->assertSame(class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a', $c->getPhpIntlLocale());
$this->assertSame(date_default_timezone_get(), $c->getPhpTimezone());
diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php
index cac06a80e5..444db71a3e 100644
--- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php
+++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php
@@ -654,7 +654,7 @@ class HttpCacheTest extends HttpCacheTestCase
$this->assertTraceContains('miss');
$this->assertTraceContains('store');
$this->assertEquals('Hello World', $this->response->getContent());
- $this->assertRegExp('/s-maxage=10/', $this->response->headers->get('Cache-Control'));
+ $this->assertMatchesRegularExpression('/s-maxage=10/', $this->response->headers->get('Cache-Control'));
$this->cacheConfig['default_ttl'] = 10;
$this->request('GET', '/');
@@ -663,7 +663,7 @@ class HttpCacheTest extends HttpCacheTestCase
$this->assertTraceContains('fresh');
$this->assertTraceNotContains('store');
$this->assertEquals('Hello World', $this->response->getContent());
- $this->assertRegExp('/s-maxage=10/', $this->response->headers->get('Cache-Control'));
+ $this->assertMatchesRegularExpression('/s-maxage=10/', $this->response->headers->get('Cache-Control'));
}
public function testAssignsDefaultTtlWhenResponseHasNoFreshnessInformationAndAfterTtlWasExpired()
@@ -676,7 +676,7 @@ class HttpCacheTest extends HttpCacheTestCase
$this->assertTraceContains('miss');
$this->assertTraceContains('store');
$this->assertEquals('Hello World', $this->response->getContent());
- $this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
+ $this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
$this->request('GET', '/');
$this->assertHttpKernelIsNotCalled();
@@ -684,7 +684,7 @@ class HttpCacheTest extends HttpCacheTestCase
$this->assertTraceContains('fresh');
$this->assertTraceNotContains('store');
$this->assertEquals('Hello World', $this->response->getContent());
- $this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
+ $this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
// expires the cache
$values = $this->getMetaStorageValues();
@@ -704,7 +704,7 @@ class HttpCacheTest extends HttpCacheTestCase
$this->assertTraceContains('invalid');
$this->assertTraceContains('store');
$this->assertEquals('Hello World', $this->response->getContent());
- $this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
+ $this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
$this->setNextResponse();
@@ -714,7 +714,7 @@ class HttpCacheTest extends HttpCacheTestCase
$this->assertTraceContains('fresh');
$this->assertTraceNotContains('store');
$this->assertEquals('Hello World', $this->response->getContent());
- $this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
+ $this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
}
public function testAssignsDefaultTtlWhenResponseHasNoFreshnessInformationAndAfterTtlWasExpiredWithStatus304()
@@ -727,7 +727,7 @@ class HttpCacheTest extends HttpCacheTestCase
$this->assertTraceContains('miss');
$this->assertTraceContains('store');
$this->assertEquals('Hello World', $this->response->getContent());
- $this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
+ $this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
$this->request('GET', '/');
$this->assertHttpKernelIsNotCalled();
@@ -755,7 +755,7 @@ class HttpCacheTest extends HttpCacheTestCase
$this->assertTraceContains('store');
$this->assertTraceNotContains('miss');
$this->assertEquals('Hello World', $this->response->getContent());
- $this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
+ $this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
$this->request('GET', '/');
$this->assertHttpKernelIsNotCalled();
@@ -763,7 +763,7 @@ class HttpCacheTest extends HttpCacheTestCase
$this->assertTraceContains('fresh');
$this->assertTraceNotContains('store');
$this->assertEquals('Hello World', $this->response->getContent());
- $this->assertRegExp('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
+ $this->assertMatchesRegularExpression('/s-maxage=(2|3)/', $this->response->headers->get('Cache-Control'));
}
public function testDoesNotAssignDefaultTtlWhenResponseHasMustRevalidateDirective()
@@ -776,7 +776,7 @@ class HttpCacheTest extends HttpCacheTestCase
$this->assertEquals(200, $this->response->getStatusCode());
$this->assertTraceContains('miss');
$this->assertTraceNotContains('store');
- $this->assertNotRegExp('/s-maxage/', $this->response->headers->get('Cache-Control'));
+ $this->assertDoesNotMatchRegularExpression('/s-maxage/', $this->response->headers->get('Cache-Control'));
$this->assertEquals('Hello World', $this->response->getContent());
}
diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php
index 1eb4617447..3cbea5e4ee 100644
--- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php
+++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php
@@ -91,7 +91,7 @@ class HttpCacheTestCase extends TestCase
$traces = $this->cache->getTraces();
$traces = current($traces);
- $this->assertRegExp('/'.$trace.'/', implode(', ', $traces));
+ $this->assertMatchesRegularExpression('/'.$trace.'/', implode(', ', $traces));
}
public function assertTraceNotContains($trace)
@@ -99,7 +99,7 @@ class HttpCacheTestCase extends TestCase
$traces = $this->cache->getTraces();
$traces = current($traces);
- $this->assertNotRegExp('/'.$trace.'/', implode(', ', $traces));
+ $this->assertDoesNotMatchRegularExpression('/'.$trace.'/', implode(', ', $traces));
}
public function assertExceptionsAreCaught()
diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php
index e4e2e0727b..6cbf59b9b2 100644
--- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php
+++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php
@@ -78,7 +78,7 @@ class KernelTest extends TestCase
$containerDir = __DIR__.'/Fixtures/cache/custom/'.substr(\get_class($kernel->getContainer()), 0, 16);
$this->assertTrue(unlink(__DIR__.'/Fixtures/cache/custom/FixturesCustomDebugProjectContainer.php.meta'));
$this->assertFileExists($containerDir);
- $this->assertFileNotExists($containerDir.'.legacy');
+ $this->assertFileDoesNotExist($containerDir.'.legacy');
$kernel = new CustomProjectDirKernel(function ($container) { $container->register('foo', 'stdClass')->setPublic(true); });
$kernel->boot();
@@ -86,8 +86,8 @@ class KernelTest extends TestCase
$this->assertFileExists($containerDir);
$this->assertFileExists($containerDir.'.legacy');
- $this->assertFileNotExists($legacyContainerDir);
- $this->assertFileNotExists($legacyContainerDir.'.legacy');
+ $this->assertFileDoesNotExist($legacyContainerDir);
+ $this->assertFileDoesNotExist($legacyContainerDir.'.legacy');
}
public function testBootInitializesBundlesAndContainer()
diff --git a/src/Symfony/Component/Intl/Tests/Util/GitRepositoryTest.php b/src/Symfony/Component/Intl/Tests/Util/GitRepositoryTest.php
index 0d98392ac2..ecbeb0eb52 100644
--- a/src/Symfony/Component/Intl/Tests/Util/GitRepositoryTest.php
+++ b/src/Symfony/Component/Intl/Tests/Util/GitRepositoryTest.php
@@ -54,7 +54,7 @@ class GitRepositoryTest extends TestCase
$this->assertDirectoryExists($this->targetDir.'/.git');
$this->assertSame($this->targetDir, $git->getPath());
$this->assertSame(self::REPO_URL, $git->getUrl());
- $this->assertRegExp('#^[0-9a-z]{40}$#', $git->getLastCommitHash());
+ $this->assertMatchesRegularExpression('#^[0-9a-z]{40}$#', $git->getLastCommitHash());
$this->assertNotEmpty($git->getLastAuthor());
$this->assertInstanceOf('DateTime', $git->getLastAuthoredDate());
$this->assertStringMatchesFormat('v%s', $git->getLastTag());
diff --git a/src/Symfony/Component/Security/Http/Tests/EntryPoint/DigestAuthenticationEntryPointTest.php b/src/Symfony/Component/Security/Http/Tests/EntryPoint/DigestAuthenticationEntryPointTest.php
index d75fb5f593..e1c0044eda 100644
--- a/src/Symfony/Component/Security/Http/Tests/EntryPoint/DigestAuthenticationEntryPointTest.php
+++ b/src/Symfony/Component/Security/Http/Tests/EntryPoint/DigestAuthenticationEntryPointTest.php
@@ -31,7 +31,7 @@ class DigestAuthenticationEntryPointTest extends TestCase
$response = $entryPoint->start($request, $authenticationException);
$this->assertEquals(401, $response->getStatusCode());
- $this->assertRegExp('/^Digest realm="TheRealmName", qop="auth", nonce="[a-zA-Z0-9\/+]+={0,2}"$/', $response->headers->get('WWW-Authenticate'));
+ $this->assertMatchesRegularExpression('/^Digest realm="TheRealmName", qop="auth", nonce="[a-zA-Z0-9\/+]+={0,2}"$/', $response->headers->get('WWW-Authenticate'));
}
public function testStartWithNoException()
@@ -42,7 +42,7 @@ class DigestAuthenticationEntryPointTest extends TestCase
$response = $entryPoint->start($request);
$this->assertEquals(401, $response->getStatusCode());
- $this->assertRegExp('/^Digest realm="TheRealmName", qop="auth", nonce="[a-zA-Z0-9\/+]+={0,2}"$/', $response->headers->get('WWW-Authenticate'));
+ $this->assertMatchesRegularExpression('/^Digest realm="TheRealmName", qop="auth", nonce="[a-zA-Z0-9\/+]+={0,2}"$/', $response->headers->get('WWW-Authenticate'));
}
public function testStartWithNonceExpiredException()
@@ -55,6 +55,6 @@ class DigestAuthenticationEntryPointTest extends TestCase
$response = $entryPoint->start($request, $nonceExpiredException);
$this->assertEquals(401, $response->getStatusCode());
- $this->assertRegExp('/^Digest realm="TheRealmName", qop="auth", nonce="[a-zA-Z0-9\/+]+={0,2}", stale="true"$/', $response->headers->get('WWW-Authenticate'));
+ $this->assertMatchesRegularExpression('/^Digest realm="TheRealmName", qop="auth", nonce="[a-zA-Z0-9\/+]+={0,2}", stale="true"$/', $response->headers->get('WWW-Authenticate'));
}
}
diff --git a/src/Symfony/Component/Yaml/Tests/Command/LintCommandTest.php b/src/Symfony/Component/Yaml/Tests/Command/LintCommandTest.php
index 349897859f..d19185f166 100644
--- a/src/Symfony/Component/Yaml/Tests/Command/LintCommandTest.php
+++ b/src/Symfony/Component/Yaml/Tests/Command/LintCommandTest.php
@@ -34,7 +34,7 @@ class LintCommandTest extends TestCase
$ret = $tester->execute(['filename' => $filename], ['verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false]);
$this->assertEquals(0, $ret, 'Returns 0 in case of success');
- $this->assertRegExp('/^\/\/ OK in /', trim($tester->getDisplay()));
+ $this->assertMatchesRegularExpression('/^\/\/ OK in /', trim($tester->getDisplay()));
}
public function testLintIncorrectFile()