From dc22a28cf6266e96cf75577ec342f66e4900d2f7 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 3 Mar 2022 15:41:47 +0100 Subject: [PATCH] wip --- tests/Filesystem/FilesystemAdapterTest.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/Filesystem/FilesystemAdapterTest.php b/tests/Filesystem/FilesystemAdapterTest.php index f125edbe74ba..e8969213e85a 100644 --- a/tests/Filesystem/FilesystemAdapterTest.php +++ b/tests/Filesystem/FilesystemAdapterTest.php @@ -408,7 +408,7 @@ public function testThrowExceptionForGet() return; } - $this->fail('Exception was not thrown.'); + $this->fail('UnableToReadFile exception was not thrown.'); } public function testThrowExceptionsForReadStream() @@ -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.'); } }