EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
test disabled field
Yuri Kuznetsov86a43a703ce4
diff --git a/tests/integration/Espo/Core/Acl/AclTest.php b/tests/integration/Espo/Core/Acl/AclTest.phpindex e15e46c9d3..70898e03cc 100644--- a/tests/integration/Espo/Core/Acl/AclTest.php+++ b/tests/integration/Espo/Core/Acl/AclTest.php@@ -32,11 +32,13 @@ namespace tests\integration\Espo\Core\Acl;use Espo\Core\AclManager;use Espo\Core\Acl;use Espo\Entities\User;+use Espo\Modules\Crm\Entities\Account;use Espo\Modules\Crm\Entities\Call;use Espo\Modules\Crm\Entities\Meeting;use Espo\Modules\Crm\Entities\Task;+use tests\integration\Core\BaseTestCase;-class AclTest extends \tests\integration\Core\BaseTestCase+class AclTest extends BaseTestCase{public function testGetReadOwnerUserField(){@@ -133,4 +135,25 @@ class AclTest extends \tests\integration\Core\BaseTestCase$this->assertTrue($aclManager->checkField($user, 'Call', 'contacts'));$this->assertFalse($aclManager->checkField($user, 'Call', 'contacts', Acl\Table::ACTION_EDIT));}++ public function testDisabledField(): void+ {+ $metadata = $this->getMetadata();++ $metadata->set('entityDefs', 'Account', [+ 'fields' => [+ 'assignedUser' => [+ 'disabled' => true,+ ]+ ]+ ]);+ $metadata->save();++ $this->reCreateApplication();++ $acl = $this->getContainer()->getByClass(Acl::class);++ $this->assertFalse($acl->checkField(Account::ENTITY_TYPE, 'assignedUser'));+ $this->assertTrue($acl->checkField(Account::ENTITY_TYPE, 'name'));+ }}