Esempio n. 1
0
 public function testGetProfileDataMethod()
 {
     foreach (self::$_responseFormatsContentTypes as $respFormat => $data) {
         $retval = null;
         $this->_gravatarService->setResponseFormat($respFormat);
         if (self::$_accountEmail !== null) {
             //Perform online tests?
             $retval = $this->_gravatarService->getProfileInfo(self::$_accountEmail);
         } else {
             if ($data['response'] !== null) {
                 $this->_setHttpResponse(file_get_contents($data['response']), $data['type']);
                 $retval = $this->_gravatarService->getProfileInfo('*****@*****.**');
             }
         }
         if ($retval !== null) {
             if ($this->_gravatarService->getResponseFormat() instanceof NP_Service_Gravatar_Profiles_ResponseFormat_ParserInterface) {
                 $this->assertTrue($retval instanceof NP_Service_Gravatar_Profiles_Profile);
             } else {
                 $this->assertTrue($retval instanceof Zend_Http_Response);
             }
         }
     }
 }
Esempio n. 2
0
 public function testSettingResponseFormatFromConstructor()
 {
     $gravatarService = new NP_Service_Gravatar_Profiles('QRCode');
     $this->assertTrue($gravatarService->getResponseFormat() instanceof NP_Service_Gravatar_Profiles_ResponseFormat_QRCode);
 }