revert tests

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
Maxence Lange 2018-11-01 16:46:38 +01:00 committed by Julius Härtl
parent 0fc8a0f58e
commit 77b95ccd12
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF
2 changed files with 11 additions and 11 deletions

View file

@ -811,10 +811,9 @@ class ApiTest extends TestCase {
$result1 = $ocs->getShares('false','false','false', $this->subfolder); $result1 = $ocs->getShares('false','false','false', $this->subfolder);
$ocs->cleanup(); $ocs->cleanup();
// // test should return 2 shares within $this->folder, as the viewer have resharing rights: // test should return one share within $this->folder
// // one from the owner, the second from the reshare
$data1 = $result1->getData(); $data1 = $result1->getData();
$this->assertCount(2, $data1); $this->assertCount(1, $data1);
$s1 = reset($data1); $s1 = reset($data1);
//$request = $this->createRequest(['path' => $this->folder.$this->subfolder]); //$request = $this->createRequest(['path' => $this->folder.$this->subfolder]);
@ -822,10 +821,9 @@ class ApiTest extends TestCase {
$result2 = $ocs->getShares('false', 'false', 'false', $this->folder . $this->subfolder); $result2 = $ocs->getShares('false', 'false', 'false', $this->folder . $this->subfolder);
$ocs->cleanup(); $ocs->cleanup();
// // test should return 2 shares within $this->folder, as the viewer have resharing rights: // test should return one share within $this->folder
// // one from the owner, the second from the reshare
$data2 = $result2->getData(); $data2 = $result2->getData();
$this->assertCount(2, $data2); $this->assertCount(1, $data2);
$s2 = reset($data2); $s2 = reset($data2);
$this->assertEquals($this->subfolder, $s1['path']); $this->assertEquals($this->subfolder, $s1['path']);

View file

@ -617,10 +617,10 @@ class DefaultShareProvider implements IShareProvider {
/** /**
* Reshares for this user are shares where they are the owner. * Reshares for this user are shares where they are the owner.
*/ */
if ($node === null) { if ($reshares === false) {
if ($reshares === false) { $qb->andWhere($qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId)));
$qb->andWhere($qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId))); } else {
} else { if ($node === null) {
$qb->andWhere( $qb->andWhere(
$qb->expr()->orX( $qb->expr()->orX(
$qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)), $qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
@ -628,7 +628,9 @@ class DefaultShareProvider implements IShareProvider {
) )
); );
} }
} else { }
if ($node !== null) {
$qb->andWhere($qb->expr()->eq('file_source', $qb->createNamedParameter($node->getId()))); $qb->andWhere($qb->expr()->eq('file_source', $qb->createNamedParameter($node->getId())));
} }