public function testRepository() { $live = new Live(); $this->dm->persist($live); $this->dm->flush(); $locale = 'en'; $name = 'event name'; $place = 'event place'; $date = new \DateTime('now'); $duration = 60; $display = true; $create_serial = false; $event = new Event(); $event->setLocale($locale); $event->setLive($live); $event->setName($name); $event->setPlace($place); $event->setDate($date); $event->setDuration($duration); $event->setDisplay($display); $event->setCreateSerial($create_serial); $this->dm->persist($event); $this->dm->flush(); $this->assertEquals(1, count($this->repo->findAll())); }
public function testSetterAndGetter() { $live = new Live(); $name = 'event name'; $place = 'event place'; $date = new \DateTime(); $duration = '60'; $display = 0; $create_serial = 0; $locale = 'en'; $schedule = array('date' => $date, 'duration' => $duration); $pic = new Pic(); $imagePath = '/path/to/image.jpg'; $pic->setPath($imagePath); $event = new Event(); $event->setLive($live); $event->setName($name); $event->setPlace($place); $event->setDate($date); $event->setDuration($duration); $event->setDisplay($display); $event->setCreateSerial($create_serial); $event->setPic($pic); $event->setLocale($locale); $event->setSchedule($schedule); $this->assertEquals($live, $event->getLive()); $this->assertEquals($name, $event->getName()); $this->assertEquals($place, $event->getPlace()); $this->assertEquals($date, $event->getDate()); $this->assertEquals($duration, $event->getDuration()); $this->assertEquals($display, $event->getDisplay()); $this->assertEquals($create_serial, $event->getCreateSerial()); $this->assertEquals($locale, $event->getLocale()); $this->assertEquals($pic, $event->getPic()); $this->assertEquals($schedule, $event->getSchedule()); }