/** * @covers Mage_Captcha_Helper_Data::getCaptcha */ public function testGetCaptcha() { $store = $this->_getStoreStub(); $store->expects($this->once())->method('isAdmin')->will($this->returnValue(false)); $store->expects($this->once())->method('getConfig')->with('customer/captcha/type', null)->will($this->returnValue('zend')); $this->_object->setStore($store); $config = $this->_getConfigStub(); $config->expects($this->once())->method('getModelInstance')->with('Mage_Captcha_Model_Zend', array('formId' => 'user_create', 'helper' => $this->_object))->will($this->returnValue(new Mage_Captcha_Model_Zend(array('formId' => 'user_create')))); $this->_object->setConfig($config); $this->assertInstanceOf('Mage_Captcha_Model_Zend', $this->_object->getCaptcha('user_create')); }