From e8462872e1b689deb8314591c82e9555366ba12f Mon Sep 17 00:00:00 2001 From: Jacson Passold Date: Thu, 18 Jan 2018 12:30:57 -0200 Subject: [PATCH] test item permissions --- tests/test-items.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test-items.php b/tests/test-items.php index 2c6f11e8a..522be3455 100644 --- a/tests/test-items.php +++ b/tests/test-items.php @@ -15,6 +15,28 @@ use Tainacan\Entities; */ class Items extends TAINACAN_UnitTestCase { + /** + * @group permissions + */ + public function test_permissions () { + $collection = $this->tainacan_entity_factory->create_entity( + 'collection', + array( + 'name' => 'testePerm', + ), + true + ); + $item = $this->tainacan_entity_factory->create_entity( + 'item', + array( + 'title' => 'testeItem', + 'collection' => $collection, + ), + true + ); + $this->assertTrue($item->can_read(), 'Administrator cannot read the Item'); + $this->assertTrue($item->can_edit(), 'Administrator cannot edit the Item'); + } function teste_query(){ $type = $this->tainacan_field_factory->create_field('text');