mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 18:36:53 +00:00
Fix compatibility with PHPUnit 10
This commit is contained in:
@@ -55,7 +55,7 @@ EOF
|
||||
}
|
||||
}
|
||||
});
|
||||
$this->assertRegExp('{'.$expected.'}m', trim($twig->render('index')));
|
||||
$this->assertMatchesRegularExpression('{'.$expected.'}m', trim($twig->render('index')));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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(), []);
|
||||
|
||||
Reference in New Issue
Block a user