diff options
Diffstat (limited to 'apps/files_sharing/tests/ApiTest.php')
-rw-r--r-- | apps/files_sharing/tests/ApiTest.php | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index 5f8b17eb5c6..f39ddeb5485 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -140,7 +140,7 @@ class ApiTest extends TestCase { $result = $ocs->createShare(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $this->assertEquals(19, $data['permissions']); $this->assertEmpty($data['expiration']); @@ -164,7 +164,7 @@ class ApiTest extends TestCase { $result = $ocs->createShare(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $this->assertEquals(31, $data['permissions']); $this->assertEmpty($data['expiration']); @@ -189,7 +189,7 @@ class ApiTest extends TestCase { $result = $ocs->createShare(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $this->assertEquals(19, $data['permissions']); $this->assertEmpty($data['expiration']); @@ -212,7 +212,7 @@ class ApiTest extends TestCase { $result = $ocs->createShare(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $this->assertEquals(31, $data['permissions']); $this->assertEmpty($data['expiration']); @@ -235,7 +235,7 @@ class ApiTest extends TestCase { $result = $ocs->createShare(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $this->assertEquals(1, $data['permissions']); $this->assertEmpty($data['expiration']); $this->assertTrue(is_string($data['token'])); @@ -263,7 +263,7 @@ class ApiTest extends TestCase { $result = $ocs->createShare(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $this->assertEquals( \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_CREATE | @@ -332,7 +332,7 @@ class ApiTest extends TestCase { $result = $ocs->createShare(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); // setting new password should succeed $data2 = [ @@ -382,7 +382,7 @@ class ApiTest extends TestCase { $result = $ocs->createShare(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $this->shareManager->getShareById('ocinternal:'.$data['id']); @@ -405,7 +405,7 @@ class ApiTest extends TestCase { $result = $ocs->createShare(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $this->shareManager->getShareById('ocinternal:' . $data['id']); @@ -453,7 +453,7 @@ class ApiTest extends TestCase { $result = $ocs->getShares(); $ocs->cleanup(); - $this->assertTrue(count($result->getData()['data']) === 1); + $this->assertTrue(count($result->getData()) === 1); $this->shareManager->deleteShare($share); } @@ -482,7 +482,7 @@ class ApiTest extends TestCase { $result = $ocs->getShares(); $ocs->cleanup(); - $this->assertTrue(count($result->getData()['data']) === 2); + $this->assertTrue(count($result->getData()) === 2); $this->shareManager->deleteShare($share1); $this->shareManager->deleteShare($share2); @@ -501,7 +501,7 @@ class ApiTest extends TestCase { $result = $ocs->createShare(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); // check if we have a token $this->assertTrue(is_string($data['token'])); @@ -517,7 +517,7 @@ class ApiTest extends TestCase { $result = $ocs->getShares(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $this->assertEquals($url, current($data)['url']); // check for path @@ -526,7 +526,7 @@ class ApiTest extends TestCase { $result = $ocs->getShares(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $this->assertEquals($url, current($data)['url']); // check in share id @@ -535,7 +535,7 @@ class ApiTest extends TestCase { $result = $ocs->getShare($id); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $this->assertEquals($url, current($data)['url']); $request = $this->createRequest([]); @@ -572,7 +572,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); // test should return one share created from testCreateShare() - $this->assertTrue(count($result->getData()['data']) === 2); + $this->assertTrue(count($result->getData()) === 2); $this->shareManager->deleteShare($share1); $this->shareManager->deleteShare($share2); @@ -607,7 +607,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); // test should return one share - $this->assertTrue(count($result->getData()['data']) === 1); + $this->assertTrue(count($result->getData()) === 1); // now also ask for the reshares $request = $this->createRequest(['path' => $this->filename, 'reshares' => 'true']); @@ -616,7 +616,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); // now we should get two shares, the initial share and the reshare - $this->assertCount(2, $result->getData()['data']); + $this->assertCount(2, $result->getData()); $this->shareManager->deleteShare($share1); $this->shareManager->deleteShare($share2); @@ -643,7 +643,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); // test should return one share created from testCreateShare() - $this->assertEquals(1, count($result->getData()['data'])); + $this->assertEquals(1, count($result->getData())); $this->shareManager->deleteShare($share1); } @@ -676,7 +676,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); // test should return one share within $this->folder - $this->assertTrue(count($result->getData()['data']) === 1); + $this->assertTrue(count($result->getData()) === 1); $this->shareManager->deleteShare($share1); $this->shareManager->deleteShare($share2); @@ -749,7 +749,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); // test should return one share within $this->folder - $data = $result->getData()['data']; + $data = $result->getData(); $this->assertEquals($value['expectedResult'], $data[0]['path']); } @@ -788,7 +788,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); // test should return one share within $this->folder - $data = $result->getData()['data']; + $data = $result->getData(); // we should get exactly one result $this->assertCount(1, $data); @@ -838,7 +838,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); // test should return one share within $this->folder - $data = $result->getData()['data']; + $data = $result->getData(); // we should get exactly one result $this->assertCount(1, $data); @@ -853,7 +853,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); // test should return one share within $this->folder - $data = $result->getData()['data']; + $data = $result->getData(); // we should get exactly one result $this->assertCount(1, $data); @@ -868,7 +868,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); // test should return one share within $this->folder - $data = $result->getData()['data']; + $data = $result->getData(); // we should get exactly one result $this->assertCount(1, $data); @@ -915,7 +915,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); // test should return one share within $this->folder - $data1 = $result1->getData()['data']; + $data1 = $result1->getData(); $this->assertCount(1, $data1); $s1 = reset($data1); @@ -925,7 +925,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); // test should return one share within $this->folder - $data2 = $result2->getData()['data']; + $data2 = $result2->getData(); $this->assertCount(1, $data2); $s2 = reset($data2); @@ -976,7 +976,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); // test should return one share within $this->folder - $data = $result->getData()['data']; + $data = $result->getData(); // we should get exactly one result $this->assertCount(1, $data); @@ -1491,7 +1491,7 @@ class ApiTest extends TestCase { } $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $this->assertTrue(is_string($data['token'])); $this->assertEquals($date, substr($data['expiration'], 0, 10)); @@ -1525,7 +1525,7 @@ class ApiTest extends TestCase { $result = $ocs->createShare(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $this->assertTrue(is_string($data['token'])); $this->assertEquals($date->format('Y-m-d') . ' 00:00:00', $data['expiration']); @@ -1613,7 +1613,7 @@ class ApiTest extends TestCase { $ocs = $this->createOCS($request, self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $topId = $data['id']; @@ -1637,7 +1637,7 @@ class ApiTest extends TestCase { $result = $ocs->getShares(); $ocs->cleanup(); - $this->assertEmpty($result->getData()['data']); + $this->assertEmpty($result->getData()); } /** @@ -1654,7 +1654,7 @@ class ApiTest extends TestCase { $ocs = $this->createOCS($request, self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare(); $ocs->cleanup(); - $data = $result->getData()['data']; + $data = $result->getData(); $topId = $data['id']; @@ -1678,6 +1678,6 @@ class ApiTest extends TestCase { $result = $ocs->getShares(); $ocs->cleanup(); - $this->assertEmpty($result->getData()['data']); + $this->assertEmpty($result->getData()); } } |