Exemplo n.º 1
0
 /**
  * @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");
     }
 }
Exemplo n.º 2
0
 /**
  * @expectedException Exception
  */
 public function testGetByUserException()
 {
     $service = new Group();
     $service->setDataSource(new PDOMock());
     $service->getByUser(1);
 }