From f63c34852d858ce8ff66bdb56ebd0965115e182a Mon Sep 17 00:00:00 2001 From: Rafal Jania Date: Fri, 13 Dec 2024 09:18:02 +0100 Subject: [PATCH] fix tests --- Classes/Configuration.php | 2 +- Tests/Unit/ConfigurationTest.php | 2 +- Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/Configuration.php b/Classes/Configuration.php index 00203d4..a757970 100644 --- a/Classes/Configuration.php +++ b/Classes/Configuration.php @@ -31,7 +31,7 @@ public function __construct(Site $site = null) $siteConfiguration = $site->getConfiguration(); $this->siteKey = trim($siteConfiguration['friendlycaptcha_site_key'] ?? ''); $this->siteSecretKey = trim($siteConfiguration['friendlycaptcha_secret_key'] ?? ''); - $this->useEuPuzzleEndpoint = $siteConfiguration['friendlycaptcha_use_eu_puzzle_endpoint']; + $this->useEuPuzzleEndpoint = $siteConfiguration['friendlycaptcha_use_eu_puzzle_endpoint'] ?? false; $this->verifyUrl = trim($siteConfiguration['friendlycaptcha_verify_url'] ?? ''); $this->jsPath = trim($siteConfiguration['friendlycaptcha_js_path'] ?? ''); $this->skipDevValidation = (bool)($siteConfiguration['friendlycaptcha_skip_dev_validation'] ?? false); diff --git a/Tests/Unit/ConfigurationTest.php b/Tests/Unit/ConfigurationTest.php index a1f01d9..4202093 100644 --- a/Tests/Unit/ConfigurationTest.php +++ b/Tests/Unit/ConfigurationTest.php @@ -22,7 +22,7 @@ public function configurationIsBuiltCorrectly(): void $configuration = new Configuration(); self::assertEquals('12345', $configuration->getSiteKey()); self::assertEquals('ABCDEF', $configuration->getSiteSecretKey()); - self::assertEquals('', $configuration->getPuzzleEndpoint()); + self::assertFalse($configuration->useEuPuzzleEndpoint()); self::assertEquals('https://verify,https://verify2', $configuration->getVerifyUrl()); self::assertEquals('https://verify', $configuration->getFirstVerifyUrl()); self::assertTrue($configuration->isEnabled()); diff --git a/Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php b/Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php index e5ae211..19e0626 100644 --- a/Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php +++ b/Tests/Unit/ViewHelpers/ConfigurationViewHelperTest.php @@ -23,7 +23,7 @@ public function viewHelperReturnsProperConfiguration() self::assertSame([ 'siteKey' => '1234', 'verifyUrl' => 'https://verify,https://verify2', - 'puzzleEndpoint' => '', + 'useEuPuzzleEndpoint' => false, 'jsPath' => 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/sdk@0.1.8-site.compat.min.js', 'enabled' => true, ], $configurationViewHelper->render());