/** * @covers Kunstmaan\AdminBundle\Entity\AclChangeset::setRef * @covers Kunstmaan\AdminBundle\Entity\AclChangeset::setRefId * @covers Kunstmaan\AdminBundle\Entity\AclChangeset::setRefEntityName * @covers Kunstmaan\AdminBundle\Entity\AclChangeset::getRefId * @covers Kunstmaan\AdminBundle\Entity\AclChangeset::getRefEntityName */ public function testSetAndGetRef() { $entity = new TestEntity(1); $this->object->setRef($entity); $this->assertEquals(1, $this->object->getRefId()); $this->assertEquals('Kunstmaan\\AdminBundle\\Tests\\Entity\\TestEntity', $this->object->getRefEntityName()); }
/** * Create a new ACL changeset. * * @param AbstractEntity $entity The entity * @param array $changes The changes * @param UserInterface $user The user * * @return AclChangeset */ public function createAclChangeSet(AbstractEntity $entity, $changes, UserInterface $user) { $aclChangeset = new AclChangeset(); $aclChangeset->setRef($entity); $aclChangeset->setChangeset($changes); /* @var $user BaseUser */ $aclChangeset->setUser($user); $this->em->persist($aclChangeset); $this->em->flush(); return $aclChangeset; }