Update phpunit assertion

This commit is contained in:
Fabien Potencier
2020-08-23 12:18:26 +02:00
parent 4ba9822987
commit e5882d9fb4
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -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()
+1 -1
View File
@@ -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.');
}
}