/** * {@inheritdoc} */ protected function deleteEntity($entity, ObjectManager $em) { parent::deleteEntity($entity, $em); if ($this->aclSidManager->isAclEnabled()) { $this->aclSidManager->deleteSid($this->aclSidManager->getSid($entity)); } }
public function testIsAclEnabled() { $manager = new AclSidManager(); $this->assertFalse($manager->isAclEnabled()); $aclProvider = $this->getMockBuilder('Oro\\Bundle\\SecurityBundle\\Acl\\Dbal\\MutableAclProvider')->disableOriginalConstructor()->getMock(); $manager = new AclSidManager($aclProvider); $this->assertTrue($manager->isAclEnabled()); }