assertDirectoryIsReadable()
assertDirectoryIsReadable(string $directory[, string $message = ''])
Reports an error identified by $message if the directory specified by $directory is not a directory or is not readable.
assertDirectoryNotIsReadable() is the inverse of this assertion and takes the same arguments.
Example A.12: Usage of assertDirectoryIsReadable()
<?php
use PHPUnit\Framework\TestCase;
class DirectoryIsReadableTest extends TestCase
{
public function testFailure()
{
$this->assertDirectoryIsReadable('/path/to/directory');
}
}
?>
phpunit DirectoryIsReadableTest PHPUnit 5.6.0 by Sebastian Bergmann and contributors. F Time: 0 seconds, Memory: 4.75Mb There was 1 failure: 1) DirectoryIsReadableTest::testFailure Failed asserting that "/path/to/directory" is readable. /home/sb/DirectoryIsReadableTest.php:6 FAILURES! Tests: 1, Assertions: 1, Failures: 1.
Please login to continue.