Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.3']
php-version: ['8.2', '8.4']

steps:
- uses: actions/checkout@v4
Expand All @@ -41,15 +41,15 @@ jobs:
env:
XDEBUG_MODE: coverage
run: |
if [[ '${{ matrix.php-version }}' == '8.1' ]]; then
if [[ '${{ matrix.php-version }}' == '8.2' ]]; then
export CODECOVERAGE=1
vendor/bin/phpunit --display-warnings --display-incomplete --coverage-clover=coverage.xml
else
vendor/bin/phpunit --display-phpunit-deprecations --display-deprecations --display-warnings
fi

- name: Submit code coverage
if: matrix.php-version == '8.1'
if: matrix.php-version == '8.2'
uses: codecov/codecov-action@v5
with:
files: coverage.xml
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
"source": "https://github.com/Erwane/cakephp-hcaptcha"
},
"require": {
"php": "^8.1",
"cakephp/cakephp": "^5.0"
"php": "^8.2",
"cakephp/cakephp": "^5.3"
},
"require-dev": {
"cakephp/cakephp-codesniffer": "^5.0",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpro/grumphp": "^2.0",
"phpunit/phpunit": "^10.5.5 || ^11.1.3"
"phpunit/phpunit": "^11.1.3"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 0 additions & 2 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
<arg name="severity=1"/>
<arg name="extensions=php"/>

<config name="installed_paths" value="../../cakephp/cakephp-codesniffer"/>

<file>src/</file>
<file>tests/</file>

Expand Down
4 changes: 2 additions & 2 deletions src/Plugin.php → src/HCaptchaPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
use Cake\Event\EventManager;

/**
* Class Plugin
* Class HCaptchaPlugin
*
* @package HCaptcha
*/
class Plugin extends BasePlugin
class HCaptchaPlugin extends BasePlugin
{
/**
* Initialize plugin.
Expand Down
2 changes: 1 addition & 1 deletion src/View/Widget/HCaptchaWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function render(array $data, ContextInterface $context): string
if ($data['recaptchacompat'] !== null) {
$queryArgs['recaptchacompat'] = in_array(
$data['recaptchacompat'],
[1, '1', 'y', 'Y', 'yes', 'on']
[1, '1', 'y', 'Y', 'yes', 'on'],
) ? 'on' : 'off';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@
use Cake\TestSuite\TestCase;
use Cake\View\Helper\FormHelper;
use Cake\View\View;
use HCaptcha\Plugin;
use HCaptcha\HCaptchaPlugin;
use HCaptcha\View\Widget\HCaptchaWidget;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;

/**
* Plugin tests
* HCaptchaPlugin tests
*/
#[UsesClass(Plugin::class)]
#[CoversClass(Plugin::class)]
class PluginTest extends TestCase
#[UsesClass(HCaptchaPlugin::class)]
#[CoversClass(HCaptchaPlugin::class)]
class HCaptchaPluginTest extends TestCase
{
/**
* @var \HCaptcha\Plugin
* @var \HCaptcha\HCaptchaPlugin
*/
private $plugin;

protected function setUp(): void
{
parent::setUp();

$this->plugin = new Plugin();
$this->plugin = new HCaptchaPlugin();
}

public function testInitialize(): void
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/View/Widget/HCaptchaWidgetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function testRenderWithoutJs(): void
$this->form->expects($this->exactly(2))
->method('unlockField')
->with(
...self::withConsecutive(['field'], ['g-recaptcha-response'])
...self::withConsecutive(['field'], ['g-recaptcha-response']),
);

$this->html->expects($this->never())->method('script');
Expand Down Expand Up @@ -103,7 +103,7 @@ public function testRenderWithOptions(): void
->method('script')
->with(
'https://hcaptcha.com/1/api.js?onload=myFunction&render=explicit&hl=fr&recaptchacompat=off',
['block' => 'script', 'async', 'defer']
['block' => 'script', 'async', 'defer'],
);

$result = $this->widget->render([
Expand Down
Loading