mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-08 08:26:46 +00:00
Update phpunit assertion
This commit is contained in:
@@ -68,8 +68,8 @@ class FilesystemTest extends \PHPUnit\Framework\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);
|
||||
|
||||
@@ -90,7 +90,7 @@ class FilesystemTest extends \PHPUnit\Framework\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);
|
||||
@@ -111,7 +111,7 @@ class FilesystemTest extends \PHPUnit\Framework\TestCase
|
||||
$key = $this->directory.'/cache/cachefile.php';
|
||||
$content = $this->generateSource();
|
||||
|
||||
$this->assertFileNotExists($key);
|
||||
$this->assertFileDoesNotExist($key);
|
||||
|
||||
// Create root directory.
|
||||
@mkdir($this->directory, 0777, true);
|
||||
@@ -130,7 +130,7 @@ class FilesystemTest extends \PHPUnit\Framework\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);
|
||||
@@ -167,7 +167,7 @@ class FilesystemTest extends \PHPUnit\Framework\TestCase
|
||||
public function testGenerateKey($expected, $input)
|
||||
{
|
||||
$cache = new FilesystemCache($input);
|
||||
$this->assertRegExp($expected, $cache->generateKey('_test_', \get_class($this)));
|
||||
$this->assertMatchesRegularExpression($expected, $cache->generateKey('_test_', \get_class($this)));
|
||||
}
|
||||
|
||||
public function provideDirectories()
|
||||
|
||||
@@ -61,6 +61,6 @@ class FileCachingTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$this->assertFileExists($cacheFileName, 'Cache file does not exist.');
|
||||
$this->env->clearCacheFiles();
|
||||
$this->assertFileNotExists($cacheFileName, 'Cache file was not cleared.');
|
||||
$this->assertFileDoesNotExist($cacheFileName, 'Cache file was not cleared.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user