/home/techb158/ileadtechnology.com/vendor/anhskohbo/no-captcha/tests
Edit: /home/techb158/ileadtechnology.com/vendor/anhskohbo/no-captcha/tests/NoCaptchaTest.php (2939B)
captcha = new NoCaptcha('{secret-key}', '{site-key}');
}
public function testRequestShouldWorks()
{
$response = $this->captcha->verifyResponse('should_false');
}
public function testJsLink()
{
$this->assertTrue($this->captcha instanceof NoCaptcha);
$simple = ''."\n";
$withLang = ''."\n";
$withCallback = ''."\n";
$this->assertEquals($simple, $this->captcha->renderJs());
$this->assertEquals($withLang, $this->captcha->renderJs('vi'));
$this->assertEquals($withCallback, $this->captcha->renderJs(null, true, 'myOnloadCallback'));
}
public function testDisplay()
{
$this->assertTrue($this->captcha instanceof NoCaptcha);
$simple = '
';
$withAttrs = '
';
$this->assertEquals($simple, $this->captcha->display());
$this->assertEquals($withAttrs, $this->captcha->display(['data-theme' => 'light']));
}
public function testdisplaySubmit()
{
$this->assertTrue($this->captcha instanceof NoCaptcha);
$javascript = '';
$simple = '
';
$withAttrs = '
';
$this->assertEquals($simple . $javascript, $this->captcha->displaySubmit('test'));
$withAttrsResult = $this->captcha->displaySubmit('test','submit123',['data-theme' => 'light', 'class' => '123']);
$this->assertEquals($withAttrs . $javascript, $withAttrsResult);
}
public function testdisplaySubmitWithCustomCallback()
{
$this->assertTrue($this->captcha instanceof NoCaptcha);
$withAttrs = '
';
$withAttrsResult = $this->captcha->displaySubmit('test-custom','submit123',['data-theme' => 'light', 'class' => '123', 'data-callback' => 'onSubmitCustomCallback']);
$this->assertEquals($withAttrs, $withAttrsResult);
}
}