Skip to content

Commit

Permalink
Add missing test for assertFileIsNotReadable #4059
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl authored and sebastianbergmann committed Feb 20, 2020
1 parent 7b597a4 commit cf2d007
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/unit/Framework/AssertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,26 @@ public function testAssertFileIsReadable(): void
$this->assertFileIsReadable(__DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting');
}

public function testAssertFileIsNotReadable(): void
{
$tempFile = \tempnam(
\sys_get_temp_dir(),
'unreadable'
);
\chmod($tempFile, \octdec('0'));

$this->assertFileIsNotReadable($tempFile);

\chmod($tempFile, \octdec('755'));

try {
$this->assertFileIsNotReadable($tempFile);
} catch (AssertionFailedError $e) {
}

\unlink($tempFile);
}

public function testAssertFileIsWritable(): void
{
$this->assertFileIsWritable(__FILE__);
Expand Down

0 comments on commit cf2d007

Please sign in to comment.