public function load(ObjectManager $manager)
 {
     $license1 = LicenseFactory::createLicense('SEN-111111', 'COMMERCIAL', 'Agile Values', 'Planning Poker', 'planning.poker', 'Vitaliy Zurian', '*****@*****.**', '+49178 174 147 4', null, '+1 months');
     $license2 = LicenseFactory::createLicense('SEN-222222', 'COMMERCIAL', 'Agile Values', 'Planning Poker', 'planning.poker', 'Vitaliy Zurian', '*****@*****.**', '+49178 174 147 4', '-1 months', '+5 days');
     $manager->persist($license1);
     $manager->persist($license2);
     $manager->flush();
 }
 public function testScheduler()
 {
     $drillSchemaEvent = new DrillSchemaEvent();
     $drillSchemaEvent->setName('some')->setDateShift('+2')->setDateField('startDate')->setLicenseTypeCondition('EVALUATION')->setAddonKey('some.addon')->setEmailTemplate('some')->setEmailSubject('some')->setEmailFromEmail('some')->setEmailFromName('some');
     $license = LicenseFactory::createLicense('SEN-111111', 'EVALUATION', 'Agile Values', 'Planning Poker', 'some.addon', 'Vitaliy Zurian', '*****@*****.**', '+49178 174 147 4', null, '+1 months');
     $this->em->persist($drillSchemaEvent);
     $this->em->persist($license);
     $this->em->flush();
     $scheduler = new Scheduler($this->em);
     // Asserting that events and schemas were created
     $scheduler->schedule();
     $drillRegisteredSchemas = $this->em->getRepository('AppBundle:DrillRegisteredSchema')->findAll();
     $drillRegisteredEvents = $this->em->getRepository('AppBundle:DrillSchemaEvent')->findAll();
     $this->assertCount(1, $drillRegisteredSchemas);
     $this->assertCount(1, $drillRegisteredEvents);
     // Asserting that no consequent events and schemas were created for the same add-on
     $scheduler->schedule();
     $drillRegisteredSchemas = $this->em->getRepository('AppBundle:DrillRegisteredSchema')->findAll();
     $drillRegisteredEvents = $this->em->getRepository('AppBundle:DrillSchemaEvent')->findAll();
     $this->assertCount(1, $drillRegisteredSchemas);
     $this->assertCount(1, $drillRegisteredEvents);
 }