$roleType2 = TestUtil::createSampleRoleType("NAME2"); $this->em->persist($roleType1); $this->em->persist($roleType2); // Create a user $userWithRoles = TestUtil::createSampleUser("Test", "Testing", "/c=test"); $this->em->persist($userWithRoles); $userId = $userWithRoles->getId(); // Create an NGI, site and services $ngi = TestUtil::createSampleNGI("MYNGI"); $site1 = TestUtil::createSampleSite('site1'); $site2 = TestUtil::createSampleSite('site2'); $service1 = TestUtil::createSampleService('site1_service1'); $service2 = TestUtil::createSampleService('site1_service2'); $endpoint1 = TestUtil::createSampleEndpointLocation(); $downtime1 = TestUtil::createSampleDowntime(); $downtime2 = TestUtil::createSampleDowntime(); $service1->addEndpointLocationDoJoin($endpoint1); $downtime1->addEndpointLocation($endpoint1); $downtime2->addEndpointLocation($endpoint1); $site1->addServiceDoJoin($service1); $site1->addServiceDoJoin($service2); $ngi->addSiteDoJoin($site1); $ngi->addSiteDoJoin($site2); $certStatusLog1 = TestUtil::createSampleCertStatusLog(); $certStatusLog2 = TestUtil::createSampleCertStatusLog(); $site2->addCertificationStatusLog($certStatusLog1); $site2->addCertificationStatusLog($certStatusLog2); $this->em->persist($ngi); $this->em->persist($site1); $this->em->persist($site2); $this->em->persist($service1);
$service1->addEndpointLocationDoJoin($endpoint1); $service1->addEndpointLocationDoJoin($endpoint2); $service2 = TestUtil::createSampleService('site1_service2'); $endpoint2_1 = TestUtil::createSampleEndpointLocation(); $endpoint2_2 = TestUtil::createSampleEndpointLocation(); $service2->addEndpointLocationDoJoin($endpoint2_1); $service2->addEndpointLocationDoJoin($endpoint2_2); // create downtimes $downtime1 = TestUtil::createSampleDowntime(); $downtime2 = TestUtil::createSampleDowntime(); $downtime3 = TestUtil::createSampleDowntime(); $downtime4 = TestUtil::createSampleDowntime(); $downtime5 = TestUtil::createSampleDowntime(); $downtime6 = TestUtil::createSampleDowntime(); $downtime7 = TestUtil::createSampleDowntime(); $downtimeOrphan = TestUtil::createSampleDowntime(); $downtimeOrphan->setDescription("orphan"); // link downtimes to services and service-endpoints $downtime1->addEndpointLocation($endpoint1); $downtime1->addService($service1); $downtime2->addEndpointLocation($endpoint1); $downtime2->addService($service1); $downtime3->addEndpointLocation($endpoint2); $downtime3->addService($service1); $downtime4->addEndpointLocation($endpoint2); //$downtime4->addService($service1); // downtime4 is not linked to service !!! //$downtime5->addEndpointLocation($endpoint2); // downtime5 is not linked to endpoint $downtime5->addService($service1); $downtime6->addService($service1); //$downtime4->addEndpointLocation($endpoint2_1); // downtiem4 is not linked to endpoint ! $downtime4->addService($service2);