Example #1
0
 /**
  * Test profile URLs.
  *
  * @param string $email   User email.
  * @param string $format  Request format (default json).
  * @param array  $options Request options.
  * 
  * @covers ::getProfileUrl
  * @dataProvider getProfileUrlDataProvider
  *
  * @return void
  */
 public function testGetProfileUrl($email, $format = 'json', array $options = [])
 {
     $client = new Client();
     $url = $client->getProfileUrl($email, $format, $options);
     $regexp = '/^.+\\/[a-zA-Z0-9]{32,32}\\.(json|php|vcf|xml|qr)(\\?.+)?/';
     $this->assertRegExp($regexp, $url);
     $this->assertNotFalse(filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED));
     $this->assertStringStartsWith('https://www.gravatar.com/', $url);
 }