diff --git a/LocalFilesystemAdapterTest.php b/LocalFilesystemAdapterTest.php index 8cb26ac..b17e32d 100644 --- a/LocalFilesystemAdapterTest.php +++ b/LocalFilesystemAdapterTest.php @@ -536,6 +536,20 @@ public function moving_a_file(): void $this->assertFileDoesNotExist(static::ROOT . '/first.txt'); } + /** + * @test + */ + public function moving_a_file_with_visibility(): void + { + $adapter = new LocalFilesystemAdapter(static::ROOT, new PortableVisibilityConverter()); + $adapter->write('first.txt', 'contents', new Config()); + $this->assertFileExists(static::ROOT . '/first.txt'); + $this->assertFileHasPermissions(static::ROOT . '/first.txt', 0644); + $adapter->move('first.txt', 'second.txt', new Config(['visibility' => 'private'])); + $this->assertFileExists(static::ROOT . '/second.txt'); + $this->assertFileHasPermissions(static::ROOT . '/second.txt', 0600); + } + /** * @test */ @@ -558,6 +572,20 @@ public function copying_a_file(): void $this->assertFileExists(static::ROOT . '/first.txt'); } + /** + * @test + */ + public function copying_a_file_with_visibility(): void + { + $adapter = new LocalFilesystemAdapter(static::ROOT, new PortableVisibilityConverter()); + $adapter->write('first.txt', 'contents', new Config()); + $adapter->copy('first.txt', 'second.txt', new Config(['visibility' => 'private'])); + $this->assertFileExists(static::ROOT . '/first.txt'); + $this->assertFileHasPermissions(static::ROOT . '/first.txt', 0644); + $this->assertFileExists(static::ROOT . '/second.txt'); + $this->assertFileHasPermissions(static::ROOT . '/second.txt', 0600); + } + /** * @test */