Skip to content

Commit

Permalink
Adding more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Jun 3, 2015
1 parent 20adfa1 commit a99155e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/NoCaptchaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public function tearDown()
public function it_can_be_instantiated()
{
$this->assertInstanceOf(self::NO_CAPTCHA_CLASS, $this->noCaptcha);
$this->assertEquals(
'<script src="https://www.google.com/recaptcha/api.js" async defer></script>',
$this->noCaptcha->script()
);
}

/**
Expand Down Expand Up @@ -90,6 +94,19 @@ public function it_must_throw_api_exception_on_empty_site_key()
new NoCaptcha('secret', ' ');
}

/** @test */
public function it_can_switch_locale()
{
$locale = 'fr';
$this->noCaptcha->setLang($locale);

$this->assertInstanceOf(self::NO_CAPTCHA_CLASS, $this->noCaptcha);
$this->assertEquals(
'<script src="' . NoCaptcha::CLIENT_URL . '?hl=' . $locale . '" async defer></script>',
$this->noCaptcha->script()
);
}

/** @test */
public function it_can_render_script_tag()
{
Expand Down

0 comments on commit a99155e

Please sign in to comment.