Skip to content

Commit

Permalink
Add test for retaining visibility on LocalAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
jnoordsij committed Nov 18, 2023
1 parent f5da503 commit a14e97b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Local/LocalFilesystemAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,23 @@ public function copying_a_file_with_visibility(): void
$this->assertFileHasPermissions(static::ROOT . '/second.txt', 0600);
}

/**
* @test
*/
public function copying_a_file_retaining_visibility(): void
{
$adapter = new LocalFilesystemAdapter(static::ROOT, new PortableVisibilityConverter());
$adapter->write('first.txt', 'contents', new Config(['visibility' => 'private']));
$adapter->copy('first.txt', 'retain.txt', new Config());
$adapter->copy('first.txt', 'do-not-retain.txt', new Config(['retain_visibility' => false]));
$this->assertFileExists(static::ROOT . '/first.txt');
$this->assertFileHasPermissions(static::ROOT . '/first.txt', 0600);
$this->assertFileExists(static::ROOT . '/retain.txt');
$this->assertFileHasPermissions(static::ROOT . '/retain.txt', 0600);
$this->assertFileExists(static::ROOT . '/do-not-retain.txt');
$this->assertFileHasPermissions(static::ROOT . '/do-not-retain.txt', 0644);
}

/**
* @test
*/
Expand Down

0 comments on commit a14e97b

Please sign in to comment.