diff options
author | brantje <brantje@gmail.com> | 2016-10-15 23:18:44 +0300 |
---|---|---|
committer | brantje <brantje@gmail.com> | 2016-10-15 23:18:44 +0300 |
commit | 306c267b1bf345ab1d148566fe50964a6cefd3ec (patch) | |
tree | 3fe230042a656f1f26e937cc8d115a81d849f610 /tests | |
parent | 8a30328a7343ca913787bcdec7eb572acfc126f0 (diff) |
Fix test and typo
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/lib/Db/ShareRequestMapperTest.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/unit/lib/Db/ShareRequestMapperTest.php b/tests/unit/lib/Db/ShareRequestMapperTest.php index b56c5617..124d1760 100644 --- a/tests/unit/lib/Db/ShareRequestMapperTest.php +++ b/tests/unit/lib/Db/ShareRequestMapperTest.php @@ -249,9 +249,9 @@ class ShareRequestMapperTest extends DatabaseHelperTest { * @covers ::updatePendinRequestPermissions */ public function testUpdatePendinRequestPermissions() { - $this->markTestIncomplete("Check why the fuck the dataset array gets altered when increasing permisions"); - $this->markTestSkipped("Update works, so skipping the test"); - if (true) return; + //$this->markTestIncomplete("Check why the fuck the dataset array gets altered when increasing permisions"); + //$this->markTestSkipped("Update works, so skipping the test"); + //if (true) return; $dataset = $this->findInDataset( self::TABLES[0], @@ -263,8 +263,7 @@ class ShareRequestMapperTest extends DatabaseHelperTest { 'target_user_id', $dataset[0]['target_user_id'] ); - - $this->mapper->updatePendinRequestPermissions( + $this->mapper->updatePendingRequestPermissions( $dataset[0]['item_guid'], $dataset[0]['target_user_id'], $dataset[0]['permissions'] + 4 @@ -277,18 +276,20 @@ class ShareRequestMapperTest extends DatabaseHelperTest { $this->assertCount(count($dataset), $after_update); - foreach ($dataset as &$row) $row = ShareRequest::fromRow($row); + //foreach ($dataset as &$row) $row = ShareRequest::fromRow($row); foreach ($after_update as $row) { - if ($dataset[0]->getId() === $row->getId()){ - $this->assertNotEquals($dataset[0]->getPermissions(), $row->getPermissions()); - $this->assertSame($dataset[0]->getPermissions() + 4, $row->getPermissions()); - + if ($dataset[0]['id'] === $row->getId()){ + $old_permission = $dataset[0]['permissions']; + $newPermission = $row->getPermissions(); + $this->assertNotEquals($old_permission, $row->getPermissions()); + $this->assertSame($newPermission, $row->getPermissions()); $tmp_data = $row->jsonSerialize(); $tmp_compare = $dataset[0]->jsonSerialize(); unset($tmp_compare['permissions']); unset($tmp_data['permissions']); + $this->assertSame($tmp_compare, $tmp_data); } } |