Redaxscript\Tests\Validator\CaptchaTest::testCaptcha PHP Method

testCaptcha() public method

testCaptcha
Since: 2.6.0
public testCaptcha ( string $task = null, array $hashArray = [], integer $expect = null )
$task string
$hashArray array
$expect integer
    public function testCaptcha($task = null, $hashArray = [], $expect = null)
    {
        /* setup */
        $validator = new Validator\Captcha();
        /* actual */
        $actual = $validator->validate($task, function_exists('password_verify') ? $hashArray[0] : $hashArray[1]);
        /* compare */
        $this->assertEquals($expect, $actual);
    }