Index: Zend/Captcha/FigletTest.php =================================================================== --- Zend/Captcha/FigletTest.php (revision 11805) +++ Zend/Captcha/FigletTest.php (working copy) @@ -243,6 +243,23 @@ ->setWordLen(14); $id = $this->captcha->generate(); } + public function testShouldNotValidateEmptyInputAgainstEmptySession() + { + // Regression Test for ZF-4245 + $this->captcha->setName('foo') + ->setWordLen(6) + ->setTimeout(300); + $id = $this->captcha->generate(); + // Unset the generated word + // we have to reset $this->captcha for that + $this->captcha->getSession()->word = null; + $this->setUp(); + $this->captcha->setName('foo') + ->setWordLen(6) + ->setTimeout(300); + $empty = array($this->captcha->getName() => array('id' => $id, 'input' => '')); + $this->assertEquals(false, $this->captcha->isValid(null, $empty)); + } } class Zend_Captcha_FigletTest_SessionContainer