Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Mar 3, 2022
1 parent 1e11a68 commit dc22a28
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/Filesystem/FilesystemAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ public function testThrowExceptionForGet()
return;
}

$this->fail('Exception was not thrown.');
$this->fail('UnableToReadFile exception was not thrown.');
}

public function testThrowExceptionsForReadStream()
Expand All @@ -423,24 +423,25 @@ public function testThrowExceptionsForReadStream()
return;
}

$this->fail('Exception was not thrown.');
$this->fail('UnableToReadFile exception was not thrown.');
}

/** @requires OS Linux|Darwin */
public function testThrowExceptionsForPut()
{
mkdir(__DIR__.'/tmp/bar', 0600);
$this->filesystem->write('foo.txt', 'Hello World');

$adapter = new FilesystemAdapter($this->filesystem, $this->adapter, ['throw' => true]);
chmod(__DIR__.'/tmp/foo.txt', 0400);

$adapter = new FilesystemAdapter($this->filesystem, $this->adapter, ['throws_exceptions' => true]);

try {
$adapter->put('/bar/foo.txt', 'Hello World!');
$adapter->put('foo.txt', 'Hello World!');

$this->fail('UnableToWriteFile exception was not thrown.');
} catch (UnableToWriteFile $e) {
$this->assertTrue(true);

return;
} finally {
chmod(__DIR__.'/tmp/foo.txt', 0600);
}

$this->fail('Exception was not thrown.');
}
}

0 comments on commit dc22a28

Please sign in to comment.