Skip to content

EspoCRM – Open Source CRM Application

More test assertions

Yurii571523d6514a
diff --git a/tests/integration/Espo/Core/Acl/AclTest.php b/tests/integration/Espo/Core/Acl/AclTest.php
index a6dc34b1de..887201a797 100644
--- a/tests/integration/Espo/Core/Acl/AclTest.php
+++ b/tests/integration/Espo/Core/Acl/AclTest.php
@@ -191,6 +191,15 @@ class AclTest extends BaseTestCase
'Account' => [
Acl\Table::ACTION_CREATE => Acl\Table::LEVEL_NO,
],
+ 'Meeting' => [
+ Acl\Table::ACTION_CREATE => Acl\Table::LEVEL_YES,
+ Acl\Table::ACTION_EDIT => Acl\Table::LEVEL_NO,
+ Acl\Table::ACTION_STREAM => Acl\Table::LEVEL_NO,
+ ],
+ 'Call' => [
+ Acl\Table::ACTION_CREATE => Acl\Table::LEVEL_NO,
+ Acl\Table::ACTION_EDIT => Acl\Table::LEVEL_ALL,
+ ],
]);
$em->saveEntity($role1);
@@ -205,6 +214,15 @@ class AclTest extends BaseTestCase
'Account' => [
Acl\Table::ACTION_EDIT => Acl\Table::LEVEL_NO,
],
+ 'Meeting' => [
+ Acl\Table::ACTION_CREATE => Acl\Table::LEVEL_NO,
+ Acl\Table::ACTION_EDIT => Acl\Table::LEVEL_ALL,
+ Acl\Table::ACTION_STREAM => Acl\Table::LEVEL_NO,
+ ],
+ 'Call' => [
+ Acl\Table::ACTION_CREATE => Acl\Table::LEVEL_YES,
+ Acl\Table::ACTION_EDIT => Acl\Table::LEVEL_NO,
+ ],
]);
$em->saveEntity($role2);
@@ -223,5 +241,10 @@ class AclTest extends BaseTestCase
$this->assertFalse($aclManager->checkScope($user, 'Account', Acl\Table::ACTION_CREATE));
$this->assertFalse($aclManager->checkScope($user, 'Opportunity', Acl\Table::ACTION_EDIT));
$this->assertFalse($aclManager->checkScope($user, 'Account', Acl\Table::ACTION_EDIT));
+ $this->assertTrue($aclManager->checkScope($user, 'Meeting', Acl\Table::ACTION_CREATE));
+ $this->assertTrue($aclManager->checkScope($user, 'Meeting', Acl\Table::ACTION_EDIT));
+ $this->assertFalse($aclManager->checkScope($user, 'Meeting', Acl\Table::ACTION_STREAM));
+ $this->assertTrue($aclManager->checkScope($user, 'Call', Acl\Table::ACTION_CREATE));
+ $this->assertTrue($aclManager->checkScope($user, 'Call', Acl\Table::ACTION_EDIT));
}
}