Fix compatibility with PHPUnit 10

This commit is contained in:
Jérôme TAMARELLE
2020-07-29 02:56:15 +02:00
parent e063bab1a6
commit 9a83f7edf6
3 changed files with 9 additions and 9 deletions
@@ -55,7 +55,7 @@ EOF
}
}
});
$this->assertRegExp('{'.$expected.'}m', trim($twig->render('index')));
$this->assertMatchesRegularExpression('{'.$expected.'}m', trim($twig->render('index')));
}
}
+6 -6
View File
@@ -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()
+2 -2
View File
@@ -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(), []);