Skip to content

Commit

Permalink
Add tests for copying and moving files with visibility specifier
Browse files Browse the repository at this point in the history
  • Loading branch information
jnoordsij committed Nov 3, 2023
1 parent 0be2154 commit b7e7966
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/Local/LocalFilesystemAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down

0 comments on commit b7e7966

Please sign in to comment.