Exemplo n.º 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'])];
 }
Exemplo n.º 2
0
 /**
  * Test if a user exists.
  * 
  * @covers ::exists
  *
  * @return void
  */
 public function testExists()
 {
     $client = new Client();
     $this->assertFalse($client->exists('test'));
     $this->assertTrue($client->exists('*****@*****.**'));
 }