public function testSetOrganizationForPublic() { $obj = new SystemCalendar(); $obj->setPublic(true); $this->assertTrue($obj->isPublic()); $this->assertNull($obj->getOrganization()); $obj->setOrganization(new Organization()); $this->assertNull($obj->getOrganization()); }
/** * Test update of system calendar */ public function testPreUpdateSystemCalendar() { $organization = new Organization(); $entity = new SystemCalendar(); $this->assertNull($entity->getOrganization()); $changeSet = []; $args = new PreUpdateEventArgs($entity, $this->em, $changeSet); $token = new UsernamePasswordOrganizationToken(new User(), 'admin', 'key', $organization); $this->securityContext->expects($this->once())->method('getToken')->will($this->returnValue($token)); $this->listener->preUpdate($args); $this->assertSame($organization, $entity->getOrganization()); }