/** * 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); }
/** * 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); }