summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-08 17:58:26 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-08 17:58:26 +0100
commit698a6b07a833246f62aa950833c7d931ea1c8a63 (patch)
tree3224c487d34b38188ef40aba84f3ac101cdaa3aa /apps/files_sharing/tests
parenta03279a3a857c59775f6ad54aeaebac7d6c2073b (diff)
parent3c4e51179242b4a8cfe741034cdd4d0f1e21229f (diff)
downloadnextcloud-server-698a6b07a833246f62aa950833c7d931ea1c8a63.tar.gz
nextcloud-server-698a6b07a833246f62aa950833c7d931ea1c8a63.zip
Merge pull request #22206 from owncloud/share2_migration_with_federated
Update the migration step to include federated shares
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r--apps/files_sharing/tests/migrationtest.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/apps/files_sharing/tests/migrationtest.php b/apps/files_sharing/tests/migrationtest.php
index e1c047e0342..8a40b76a642 100644
--- a/apps/files_sharing/tests/migrationtest.php
+++ b/apps/files_sharing/tests/migrationtest.php
@@ -209,6 +209,23 @@ class MigrationTest extends TestCase {
$this->assertSame(1,
$query->execute()
);
+ $parent = $query->getLastInsertId();
+ // third re-share, should be attached to the first user share after migration
+ $query->setParameter('share_type', \OCP\Share::SHARE_TYPE_REMOTE)
+ ->setParameter('share_with', 'user@server.com')
+ ->setParameter('uid_owner', 'user3')
+ ->setParameter('uid_initiator', '')
+ ->setParameter('parent', $parent)
+ ->setParameter('item_type', 'file')
+ ->setParameter('item_source', '2')
+ ->setParameter('item_target', '/2')
+ ->setParameter('file_source', 2)
+ ->setParameter('file_target', '/foobar')
+ ->setParameter('permissions', 31)
+ ->setParameter('stime', time());
+ $this->assertSame(1,
+ $query->execute()
+ );
}
public function testRemoveReShares() {
@@ -221,7 +238,7 @@ class MigrationTest extends TestCase {
$query = $this->connection->getQueryBuilder();
$query->select('*')->from($this->table)->orderBy('id');
$result = $query->execute()->fetchAll();
- $this->assertSame(8, count($result));
+ $this->assertSame(9, count($result));
// shares which shouldn't be modified
for ($i = 0; $i < 4; $i++) {
@@ -238,7 +255,7 @@ class MigrationTest extends TestCase {
$this->assertEmpty($result[5]['uid_initiator']);
$this->assertNull($result[5]['parent']);
// flatted re-shares
- for($i = 6; $i < 8; $i++) {
+ for($i = 6; $i < 9; $i++) {
$this->assertSame('owner2', $result[$i]['uid_owner']);
$user = 'user' . ($i - 5);
$this->assertSame($user, $result[$i]['uid_initiator']);