/** * @param $id * @return \Stjornvisi\Service\Group * @throws NotifyException * @throws \Stjornvisi\Service\Exception */ private function getGroup($id) { $groupService = new GroupService(); $groupService->setDataSource($this->getDataSourceDriver())->setEventManager($this->getEventManager()); if (($group = $groupService->get($id)) != false) { return $group; } else { throw new NotifyException("Group [{$id}] not found"); } }
/** * @expectedException Exception */ public function testGetException() { $service = new Group(); $service->setDataSource(new PDOMock()); $service->get(1); }