/** * 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()); }