Ejemplo n.º 1
0
 /**
  * testForceDefault
  *
  * @return void
  */
 public function testForceDefault()
 {
     $result = $this->Gravatar->url('*****@*****.**', array('forcedefault' => true));
     $this->assertPattern('/\\?/', $result);
     list($url, $params) = explode('?', $result);
     $this->assertPattern('/f=y/', $params);
 }
Ejemplo n.º 2
0
 /**
  * testSecureUrl
  *
  * @return void
  * @access public
  */
 public function testSecureUrl()
 {
     $expected = 'https://secure.gravatar.com/avatar/' . Security::hash('*****@*****.**', 'md5');
     $result = $this->Gravatar->url('*****@*****.**', array('ext' => false, 'secure' => true));
     $this->assertEqual($expected, $result);
     $_SERVER['HTTPS'] = true;
     $expected = 'https://secure.gravatar.com/avatar/' . Security::hash('*****@*****.**', 'md5');
     $result = $this->Gravatar->url('*****@*****.**', array('ext' => false));
     $this->assertEqual($expected, $result);
     $expected = 'https://secure.gravatar.com/avatar/' . Security::hash('*****@*****.**', 'md5');
     $result = $this->Gravatar->url('*****@*****.**', array('ext' => false, 'secure' => true));
     $this->assertEqual($expected, $result);
 }