-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ossycodes/fix-tests
Fix tests
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ public function setUp(): void | |
{ | ||
parent::setUp(); | ||
|
||
$this->captcha = new FriendlyCaptcha('{secret-key}', '{site-key}'); | ||
$this->captcha = new FriendlyCaptcha('{secret-key}', '{site-key}', 'https://api.friendlycaptcha.com/api/v1/puzzle', 'https://api.friendlycaptcha.com/api/v1/siteverify'); | ||
} | ||
|
||
/** | ||
|
@@ -32,8 +32,8 @@ public function it_can_render_unpkg_widget_script_correctly() | |
{ | ||
$this->assertTrue($this->captcha instanceof FriendlyCaptcha); | ||
|
||
$expectedScriptOne = '<script type="module" src="https://unpkg.com/[email protected].8/widget.module.min.js" async defer></script>'; | ||
$expectedScriptTwo = '<script nomodule src="https://unpkg.com/[email protected].8/widget.min.js" async defer></script>'; | ||
$expectedScriptOne = '<script type="module" src="https://unpkg.com/[email protected].9/widget.module.min.js" async defer></script>'; | ||
$expectedScriptTwo = '<script nomodule src="https://unpkg.com/[email protected].9/widget.min.js" async defer></script>'; | ||
|
||
$this->assertStringContainsString($expectedScriptOne, $this->captcha->renderWidgetScripts()); | ||
$this->assertStringContainsString($expectedScriptTwo, $this->captcha->renderWidgetScripts()); | ||
|
@@ -46,8 +46,8 @@ public function it_can_render_jsdelivr_widget_script_correctly() | |
{ | ||
$this->assertTrue($this->captcha instanceof FriendlyCaptcha); | ||
|
||
$expectedScriptOne = '<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected].8/widget.module.min.js" async defer></script>'; | ||
$expectedScriptTwo = '<script nomodule src="https://cdn.jsdelivr.net/npm/[email protected].8/widget.min.js" async defer></script>'; | ||
$expectedScriptOne = '<script type="module" src="https://cdn.jsdelivr.net/npm/[email protected].9/widget.module.min.js" async defer></script>'; | ||
$expectedScriptTwo = '<script nomodule src="https://cdn.jsdelivr.net/npm/[email protected].9/widget.min.js" async defer></script>'; | ||
|
||
$this->assertStringContainsString($expectedScriptOne, $this->captcha->renderWidgetScripts('jsdelivr')); | ||
$this->assertStringContainsString($expectedScriptTwo, $this->captcha->renderWidgetScripts('jsdelivr')); | ||
|
@@ -60,8 +60,8 @@ public function it_can_render_widget_correctly() | |
{ | ||
$this->assertTrue($this->captcha instanceof FriendlyCaptcha); | ||
|
||
$expectedWidget = '<div data-sitekey="{site-key}" class="frc-captcha"></div>'; | ||
$expectedWidgetWithCustomAttributes = '<div data-sitekey="{site-key}" class="frc-captcha dark"></div>'; | ||
$expectedWidget = '<div data-puzzle-endpoint="https://api.friendlycaptcha.com/api/v1/puzzle" data-sitekey="{site-key}" class="frc-captcha" data-lang="en"></div>'; | ||
$expectedWidgetWithCustomAttributes = '<div data-puzzle-endpoint="https://api.friendlycaptcha.com/api/v1/puzzle" data-sitekey="{site-key}" class="frc-captcha dark"></div>'; | ||
|
||
$this->assertEquals($expectedWidget, $this->captcha->renderWidget()); | ||
$this->assertEquals($expectedWidgetWithCustomAttributes, $this->captcha->renderWidget(['dark-theme' => true])); | ||
|