Exemplo n.º 1
0
 /**
  * Setup Gravatar
  *
  * @param array $options
  * @return Robo47_Service_Gravatar
  */
 protected function _setupService($options)
 {
     $gravatar = new Robo47_Service_Gravatar();
     if (isset($options['rating'])) {
         $gravatar->setRating($options['rating']);
     }
     if (isset($options['size'])) {
         $gravatar->setSize($options['size']);
     }
     if (isset($options['default'])) {
         $gravatar->setDefault($options['default']);
     }
     if (isset($options['cachePrefix'])) {
         $gravatar->setCachePrefix($options['cachePrefix']);
     }
     if (isset($options['useSSL'])) {
         $gravatar->useSSL($options['useSSL']);
     }
     if (isset($options['cache'])) {
         $gravatar->setCache($options['cache']);
     }
     if (isset($options['registryKey'])) {
         Zend_Registry::set($options['registryKey'], $gravatar);
     }
     return $gravatar;
 }
Exemplo n.º 2
0
 /**
  * @covers Robo47_Service_Gravatar::setCachePrefix
  * @covers Robo47_Service_Gravatar::getCachePrefix
  */
 public function testSetCachePrefixGetCachePrefix()
 {
     $service = new Robo47_Service_Gravatar();
     $return = $service->setCachePrefix('prefix_');
     $this->assertSame($return, $service, 'Fluent Interface failed');
     $this->assertEquals('prefix_', $service->getCachePrefix(), 'Setting cachePrefix failed');
 }