/** * {@inheritdoc} */ public function import() { if ($this->findById(1)) { return; } $event = new Event(); $event->setId(1); $event->setLocation($this->findLocation()); $event->setName('Evento de exemplo'); $event->setStartDate(DateTime::createFromFormat('H:i:s', '00:00:00')); $event->setEndDate(DateTime::createFromFormat('H:i:s', '23:59:59')); $event->setSubmissionStart(DateTime::createFromFormat('H:i:s', '00:00:00')); $event->setSubmissionEnd(DateTime::createFromFormat('H:i:s', '23:59:59')); $event->getEndDate()->modify('+30 days'); $event->getSubmissionEnd()->modify('+30 days'); $this->forceAssignedIds($event); $this->manager->persist($event); $this->manager->flush(); }
/** * @test * @covers PHPSC\Conference\Domain\Entity\Event::__construct * @covers PHPSC\Conference\Domain\Entity\Event::getSubmissionStart * @covers PHPSC\Conference\Domain\Entity\Event::setSubmissionStart * @covers PHPSC\Conference\Domain\Entity\Event::getSubmissionEnd * @covers PHPSC\Conference\Domain\Entity\Event::setSubmissionEnd * @covers PHPSC\Conference\Domain\Entity\Event::hasTalkSubmissions * @covers PHPSC\Conference\Domain\Entity\Event::getTalkEvaluationEnd * @covers PHPSC\Conference\Domain\Entity\Event::isSpeakerPromotionalPeriod */ public function isSpeakerPromotionalPeriodShouldReturnTrueWhenGivenDateIsBetweenEvaluationEndAndAWeekAfterIt() { $event = new Event(); $event->setSubmissionStart(new DateTime('2014-04-01 00:00:00')); $event->setSubmissionEnd(new DateTime('2014-05-31 23:59:59')); $this->assertTrue($event->isSpeakerPromotionalPeriod(new DateTime('2014-06-14 23:59:59'))); }