/** * 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; }
/** * @covers Robo47_Service_Gravatar::setSize */ public function testSetTooSmallSize() { $service = new Robo47_Service_Gravatar(); try { $service->setSize(0); $this->fail('no exception thrown setSize() with too small value'); } catch (Robo47_Service_Gravatar_Exception $e) { $this->assertEquals('size is smaller than 1', $e->getMessage(), 'Wrong exception message'); } }