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'); }
/** * @param string $username * * @throws UserNotFoundException * @return UserInterface */ public function getUser($username) { return $this->userResource->getUserByUsername($username); }