예제 #1
0
 public function testGetUserByUsernameServerError()
 {
     $that = $this;
     $this->getMockHttpClient()->expects($this->once())->method('get')->will($this->returnValue($this->createMockRequest(function ($request) use($that) {
         return $that->throwException(ServerErrorResponseException::factory($request, $that->createMockResponse()));
     })));
     $this->setExpectedException('Guzzle\\Http\\Exception\\BadResponseException');
     $this->resource->getUserByUsername('test');
 }
예제 #2
0
 /**
  * @param string $username
  *
  * @throws UserNotFoundException
  * @return UserInterface
  */
 public function getUser($username)
 {
     return $this->userResource->getUserByUsername($username);
 }