public function testGet() { $service = new Event(); $service->setDataSource(self::$pdo); $this->assertInstanceOf('stdClass', $service->get(1)); $this->assertInstanceOf('stdClass', $service->get(2)); $this->assertInstanceOf('stdClass', $service->get(1, 1)); $this->assertFalse($service->get(1000)); }
public function testGet() { $event = $this->service->get(1); $this->assertInternalType('int', $event->id); $this->assertInstanceOf('\\Stjornvisi\\Lib\\Time', $event->event_time); $this->assertInstanceOf('\\Stjornvisi\\Lib\\Time', $event->event_end); $this->assertInstanceOf('\\DateTime', $event->event_date); $this->assertNull($event->capacity); $this->assertNull($event->avatar); $event = $this->service->get(2); $this->assertInternalType('int', $event->id); $this->assertInstanceOf('\\Stjornvisi\\Lib\\Time', $event->event_time); $this->assertInstanceOf('\\Stjornvisi\\Lib\\Time', $event->event_end); $this->assertInstanceOf('\\DateTime', $event->event_date); $this->assertNull($event->capacity); $this->assertNull($event->avatar); $event = $this->service->get(3); $this->assertInternalType('int', $event->id); $this->assertInstanceOf('\\Stjornvisi\\Lib\\Time', $event->event_time); $this->assertNull($event->event_end); $this->assertInstanceOf('\\DateTime', $event->event_date); $this->assertInternalType('int', $event->capacity); $this->assertNotNull($event->avatar); }