Skip to content

Commit

Permalink
Add new cases for transfer-ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
jvillafanez committed Oct 28, 2019
1 parent 19a540b commit 2489934
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions apps/files/tests/Command/TransferOwnershipTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@ private function createTestFilesForSourceUser() {
->setShareType(Share::SHARE_TYPE_USER)
->setPermissions(19);
$this->shareManager->createShare($share);

$subFolder = $userFolder->get('transfer/sub_folder');
$share = $this->shareManager->newShare();
$share->setNode($subFolder)
->setSharedBy('source-user')
->setSharedWith('share-receiver')
->setShareType(Share::SHARE_TYPE_USER)
->setPermissions(19);
$this->shareManager->createShare($share);
}

public function testTransferAllFiles() {
Expand All @@ -178,13 +187,13 @@ public function testTransferAllFiles() {
$sourceShares = $this->shareManager->getSharesBy($this->sourceUser->getUID(), Share::SHARE_TYPE_USER);
$targetShares = $this->shareManager->getSharesBy($this->targetUser->getUID(), Share::SHARE_TYPE_USER);
$this->assertCount(0, $sourceShares);
$this->assertCount(3, $targetShares);
$this->assertCount(4, $targetShares);
}

public function folderPathProvider() {
return [
['transfer', 1, 2],
['transfer/sub_folder', 2, 1]
['transfer', 1, 3],
['transfer/sub_folder', 2, 2]
];
}

Expand Down

0 comments on commit 2489934

Please sign in to comment.