예제 #1
0
 /**
  * Returns a list of filters to add to the existing list.
  *
  * @return array An array of filters
  */
 public function getFilters()
 {
     return [new Twig_SimpleFilter('gravatar_profile_url', function ($email) {
         try {
             $profile = $this->client->getProfile($email);
         } catch (ClientException $exception) {
             return;
         }
         return $profile['profileUrl'];
     }), new Twig_SimpleFilter('gravatar_url', [$this->client, 'getAvatarUrl'])];
 }
예제 #2
0
 /**
  * Test wrong profile request.
  * 
  * @covers ::getProfile
  * @expectedException \GuzzleHttp\Exception\ClientException
  *
  * @return void
  */
 public function testGetProfileWrong()
 {
     $client = new Client();
     $client->getProfile('wrong-user');
 }