public function testFromArray() { $e = ['startDate' => new \DateTime('2014-01-01 09:00:00'), 'endDate' => new \DateTime('2014-01-01 10:00:00'), 'name' => 'Top Secret Event.']; $this->object->fromArray($e); $this->assertEquals('2014-01-01 09:00:00', $this->object->getStartDate()->format('Y-m-d H:i:s')); $this->assertEquals('2014-01-01 10:00:00', $this->object->getEndDate()->format('Y-m-d H:i:s')); $this->assertEquals('Top Secret Event.', $this->object->getName()); }