findByName() 공개 메소드

Find a group by name.
public findByName ( $name ) : mixed
$name
리턴 mixed
예제 #1
0
 /**
  * Find a group By name
  *
  * @param $group_name
  * @return mixed
  * @throws \Fenos\Notifynder\Exceptions\NotifynderGroupNotFoundException
  */
 public function findByName($group_name)
 {
     $group = $this->groupRepo->findByName($group_name);
     if (is_null($group)) {
         $error = "Group Not Found";
         throw new NotifynderGroupNotFoundException($error);
     }
     return $group;
 }
예제 #2
0
 /** @test */
 function it_try_to_find_an_not_existing_group_by_name(NotifynderGroupDB $groupDB)
 {
     $group_name = 'mygroup';
     $groupDB->findByName($group_name)->shouldBeCalled()->willReturn(null);
     $this->shouldThrow(NotifynderGroupNotFoundException::class)->during('findByName', [$group_name]);
 }