Skip to content

Commit

Permalink
tests: will throwing exception if config not set api key
Browse files Browse the repository at this point in the history
  • Loading branch information
ddevsr committed Nov 28, 2022
1 parent f0d13e6 commit ac389f8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/RecaptchaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
*/
final class RecaptchaTest extends CIUnitTestCase
{
public function testExceptionAPIKey()
{
$this->expectException(Exception::class);
$this->expectExceptionMessage('To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin');

$recaptcha = new Recaptcha();
}

public function testGetScriptTagDefault()
{
$expected = '<script type="text/javascript" src="https://www.google.com/recaptcha/api.js?render=onload&hl=id" defer></script>';
Expand Down

0 comments on commit ac389f8

Please sign in to comment.