public function testClearCaptchaSession() { $ses = $this->getMock('HTML_QuickForm2_Element_Captcha_Session_Mock', array('clear')); $ses->expects($this->once('clear'))->method('clear'); $tc = new HTML_QuickForm2_Element_Captcha_Numeral(); $tc->setSession($ses); $tc->clearCaptchaSession(); }
/** * Tests if __toString() does not render the captcha question * when question rendering is turned off and the element is frozen. */ public function test__toStringFrozenNoRender() { $this->nc = new HTML_QuickForm2_Element_Captcha_Numeral(null, null, array('captchaRender' => false)); $this->nc->setSession(new HTML_QuickForm2_Element_Captcha_Session_Mock()); $this->nc->toggleFrozen(true); $str = (string) $this->nc; //not empty string $this->assertEquals('', $str, 'Frozen string is not empty'); }