From 9a83f7edf625a2ee699a6b043ae50efec5d06a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20TAMARELLE?= Date: Wed, 29 Jul 2020 02:56:15 +0200 Subject: [PATCH] Fix compatibility with PHPUnit 10 --- extra/markdown-extra/tests/FunctionalTest.php | 2 +- tests/Cache/FilesystemTest.php | 12 ++++++------ tests/Node/Expression/CallTest.php | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/extra/markdown-extra/tests/FunctionalTest.php b/extra/markdown-extra/tests/FunctionalTest.php index 933b8120f..368a0467b 100644 --- a/extra/markdown-extra/tests/FunctionalTest.php +++ b/extra/markdown-extra/tests/FunctionalTest.php @@ -55,7 +55,7 @@ EOF } } }); - $this->assertRegExp('{'.$expected.'}m', trim($twig->render('index'))); + $this->assertMatchesRegularExpression('{'.$expected.'}m', trim($twig->render('index'))); } } diff --git a/tests/Cache/FilesystemTest.php b/tests/Cache/FilesystemTest.php index 942854dc8..478ac355a 100644 --- a/tests/Cache/FilesystemTest.php +++ b/tests/Cache/FilesystemTest.php @@ -69,8 +69,8 @@ class FilesystemTest extends TestCase $key = $this->directory.'/cache/cachefile.php'; $content = $this->generateSource(); - $this->assertFileNotExists($key); - $this->assertFileNotExists($this->directory); + $this->assertFileDoesNotExist($key); + $this->assertFileDoesNotExist($this->directory); $this->cache->write($key, $content); @@ -91,7 +91,7 @@ class FilesystemTest extends TestCase $key = $this->directory.'/cache/cachefile.php'; $content = $this->generateSource(); - $this->assertFileNotExists($key); + $this->assertFileDoesNotExist($key); // Create read-only root directory. @mkdir($this->directory, 0555, true); @@ -112,7 +112,7 @@ class FilesystemTest extends TestCase $key = $this->directory.'/cache/cachefile.php'; $content = $this->generateSource(); - $this->assertFileNotExists($key); + $this->assertFileDoesNotExist($key); // Create root directory. @mkdir($this->directory, 0777, true); @@ -131,7 +131,7 @@ class FilesystemTest extends TestCase $key = $this->directory.'/cache/cachefile.php'; $content = $this->generateSource(); - $this->assertFileNotExists($key); + $this->assertFileDoesNotExist($key); // Create a directory in the place of the cache file. @mkdir($key, 0777, true); @@ -168,7 +168,7 @@ class FilesystemTest extends TestCase public function testGenerateKey($expected, $input) { $cache = new FilesystemCache($input); - $this->assertRegExp($expected, $cache->generateKey('_test_', static::class)); + $this->assertMatchesRegularExpression($expected, $cache->generateKey('_test_', static::class)); } public function provideDirectories() diff --git a/tests/Node/Expression/CallTest.php b/tests/Node/Expression/CallTest.php index 99839b87a..0e66f0d3f 100644 --- a/tests/Node/Expression/CallTest.php +++ b/tests/Node/Expression/CallTest.php @@ -117,7 +117,7 @@ class CallTest extends TestCase public function testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnFunction() { $this->expectException(\LogicException::class); - $this->expectExceptionMessageRegExp('#^The last parameter of "Twig\\\\Tests\\\\Node\\\\Expression\\\\custom_Twig_Tests_Node_Expression_CallTest_function" for function "foo" must be an array with default value, eg\\. "array \\$arg \\= \\[\\]"\\.$#'); + $this->expectExceptionMessageMatches('#^The last parameter of "Twig\\\\Tests\\\\Node\\\\Expression\\\\custom_Twig_Tests_Node_Expression_CallTest_function" for function "foo" must be an array with default value, eg\\. "array \\$arg \\= \\[\\]"\\.$#'); $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'foo', 'is_variadic' => true]); $node->getArguments('Twig\Tests\Node\Expression\custom_Twig_Tests_Node_Expression_CallTest_function', []); @@ -126,7 +126,7 @@ class CallTest extends TestCase public function testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnObject() { $this->expectException(\LogicException::class); - $this->expectExceptionMessageRegExp('#^The last parameter of "Twig\\\\Tests\\\\Node\\\\Expression\\\\CallableTestClass\\:\\:__invoke" for function "foo" must be an array with default value, eg\\. "array \\$arg \\= \\[\\]"\\.$#'); + $this->expectExceptionMessageMatches('#^The last parameter of "Twig\\\\Tests\\\\Node\\\\Expression\\\\CallableTestClass\\:\\:__invoke" for function "foo" must be an array with default value, eg\\. "array \\$arg \\= \\[\\]"\\.$#'); $node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'foo', 'is_variadic' => true]); $node->getArguments(new CallableTestClass(), []);