mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:42 +01:00
Some more test work
- Refactoring to reduce duplication - Tests for with & without permission
This commit is contained in:
parent
10fddf70cc
commit
61c6242345
@ -48,4 +48,22 @@ class StreamWrapperTest extends StreamWrapperBase
|
||||
parent::testNoReadAccess();
|
||||
}
|
||||
|
||||
public function testWithAccess() : void
|
||||
{
|
||||
// Put it in the group directory this time so we can give access
|
||||
$this->files[] = $this->test_file = $this->getFilename('/home/Default');
|
||||
|
||||
parent::testWithAccess();
|
||||
}
|
||||
|
||||
protected function allowAccess(string $test_name, string $test_file, int $test_user, string $needed)
|
||||
{
|
||||
// We'll allow access by putting test user in Default group
|
||||
$command = new \admin_cmd_edit_user($test_user, ['account_groups' => array_merge($this->account['account_groups'],['Default'])]);
|
||||
$command->run();
|
||||
|
||||
// Add explicit permission on group
|
||||
Vfs::chmod($test_file, Vfs::mode2int('g+'.$needed));
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user