aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-01-26 12:58:41 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-01-26 14:14:54 +0100
commitc090d709e769a2bf81fb2f46780714a753de8d74 (patch)
treedbad2c9df5ab8afb8049106bf3f77d88abae6714 /tests
parent3da78c8f1c9355a726f289e834fa237366c3df20 (diff)
downloadnextcloud-server-c090d709e769a2bf81fb2f46780714a753de8d74.tar.gz
nextcloud-server-c090d709e769a2bf81fb2f46780714a753de8d74.zip
We must resolve to the proper usergroup share
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/share20/defaultshareprovidertest.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/lib/share20/defaultshareprovidertest.php b/tests/lib/share20/defaultshareprovidertest.php
index 574b1481c95..8a82be4161b 100644
--- a/tests/lib/share20/defaultshareprovidertest.php
+++ b/tests/lib/share20/defaultshareprovidertest.php
@@ -881,6 +881,27 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEquals(1, $qb->execute());
$id = $qb->getLastInsertId();
+ /*
+ * Wrong share. Should not be taken by code.
+ */
+ $qb = $this->dbConn->getQueryBuilder();
+ $qb->insert('share')
+ ->values([
+ 'share_type' => $qb->expr()->literal(2),
+ 'share_with' => $qb->expr()->literal('user2'),
+ 'uid_owner' => $qb->expr()->literal('shareOwner'),
+ 'uid_initiator' => $qb->expr()->literal('sharedBy'),
+ 'item_type' => $qb->expr()->literal('file'),
+ 'file_source' => $qb->expr()->literal(42),
+ 'file_target' => $qb->expr()->literal('wrongTarget'),
+ 'permissions' => $qb->expr()->literal(31),
+ 'parent' => $qb->expr()->literal($id),
+ ]);
+ $this->assertEquals(1, $qb->execute());
+
+ /*
+ * Correct share. should be taken by code path.
+ */
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
->values([