public function testFindUpcoming_after() { $ad = new Application(); $ad->setShow($this->show); $ad->setDeadlineDate(new \DateTime('2014-03-12')); $ad->setDeadlineTime(new \DateTime('16:00')); $ad->setText('Some text'); $ad->setFurtherInfo('Some contact details'); $this->em->persist($ad); $this->em->flush(); $res = $this->getRepository()->findLatest(3, new \DateTime('2014-03-17 13:00')); $this->assertEquals(0, count($res)); }
private function addApplications(ObjectManager $manager, Show $show) { $application = new Application(); $application->setText('Random text ' . mt_rand(1, 100)); $application->setDeadlineDate(new \DateTime(mt_rand(-5, 15) . ' days')); $application->setFurtherInfo('Further Info text ' . mt_rand(1, 100)); $application->setDeadlineTime(new \DateTime(mt_rand(0, 23) . ':' . mt_rand(0, 3) * 15)); $application->setShow($show); $manager->persist($application); }