From 44e0c53ea4eb659252dd9d755cc816ec8cdf9f65 Mon Sep 17 00:00:00 2001 From: ADmad Date: Mon, 17 Jul 2023 18:09:38 +0530 Subject: [PATCH] Updates for phpunit 10 --- .github/workflows/ci.yml | 2 +- .gitignore | 1 + composer.json | 2 +- phpunit.xml.dist | 22 ++++++------------- src/Action/DashboardAction.php | 1 + src/Dashboard/Dashboard.php | 1 + src/Listener/Traits/FormTypeTrait.php | 1 + src/Listener/ViewListener.php | 1 + src/View/Helper/CrudViewHelper.php | 1 + tests/TestCase/Dashboard/DashboardTest.php | 1 + .../View/Widget/DateTimeWidgetTest.php | 2 +- 11 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a9f666f..5301470b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: php-version: '8.1' extensions: mbstring, intl coverage: none - tools: vimeo/psalm:5, phpstan:1.9, cs2pr + tools: vimeo/psalm:5, phpstan:1.10, cs2pr - name: Composer Install run: composer require --dev cakephp/cakephp-codesniffer:^5.0 diff --git a/.gitignore b/.gitignore index 5209c916..ad935574 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ vendor/ composer.lock tmp .phpunit.result.cache +.phpunit.cache diff --git a/composer.json b/composer.json index 4f9bed6d..786e3c73 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "require-dev": { "friendsofcake/cakephp-test-utilities": "dev-cake-5.x", "markstory/asset_compress": "5.x-dev", - "phpunit/phpunit": "^9.5.19" + "phpunit/phpunit": "^10.1" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 10712c99..f6a7ea06 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,27 +1,19 @@ - + ./tests/TestCase - - + - - - - src/ - - - + + + src/ + + diff --git a/src/Action/DashboardAction.php b/src/Action/DashboardAction.php index b8e89fdc..9001fe8f 100644 --- a/src/Action/DashboardAction.php +++ b/src/Action/DashboardAction.php @@ -6,6 +6,7 @@ use Crud\Action\BaseAction; use Crud\Traits\ViewTrait; use CrudView\Dashboard\Dashboard; +use function Cake\I18n\__d; class DashboardAction extends BaseAction { diff --git a/src/Dashboard/Dashboard.php b/src/Dashboard/Dashboard.php index 9afd4872..68c10dcf 100644 --- a/src/Dashboard/Dashboard.php +++ b/src/Dashboard/Dashboard.php @@ -6,6 +6,7 @@ use Cake\Datasource\EntityTrait; use Cake\View\Cell; use InvalidArgumentException; +use function Cake\I18n\__d; class Dashboard { diff --git a/src/Listener/Traits/FormTypeTrait.php b/src/Listener/Traits/FormTypeTrait.php index d2e84a73..e00d40a0 100644 --- a/src/Listener/Traits/FormTypeTrait.php +++ b/src/Listener/Traits/FormTypeTrait.php @@ -6,6 +6,7 @@ use Cake\Controller\Controller; use Crud\Action\BaseAction; use Crud\Action\EditAction; +use function Cake\I18n\__d; trait FormTypeTrait { diff --git a/src/Listener/ViewListener.php b/src/Listener/ViewListener.php index e2add620..60de2716 100644 --- a/src/Listener/ViewListener.php +++ b/src/Listener/ViewListener.php @@ -15,6 +15,7 @@ use CrudView\Listener\Traits\SiteTitleTrait; use CrudView\Listener\Traits\UtilityNavigationTrait; use CrudView\Traits\CrudViewConfigTrait; +use function Cake\I18n\__d; class ViewListener extends BaseListener { diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index f6a9bd5a..6595e1d7 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -9,6 +9,7 @@ use Cake\Utility\Text; use Cake\View\Helper; use Cake\View\Helper\FormHelper; +use function Cake\I18n\__d; /** * @property \BootstrapUI\View\Helper\FormHelper $Form diff --git a/tests/TestCase/Dashboard/DashboardTest.php b/tests/TestCase/Dashboard/DashboardTest.php index b885b60d..06dd42a1 100644 --- a/tests/TestCase/Dashboard/DashboardTest.php +++ b/tests/TestCase/Dashboard/DashboardTest.php @@ -9,6 +9,7 @@ use CrudView\Dashboard\Dashboard; use CrudView\View\Cell\DashboardTableCell; use InvalidArgumentException; +use function Cake\I18n\__d; /** * DashboardTest class diff --git a/tests/TestCase/View/Widget/DateTimeWidgetTest.php b/tests/TestCase/View/Widget/DateTimeWidgetTest.php index 55c440c6..8abd06d4 100644 --- a/tests/TestCase/View/Widget/DateTimeWidgetTest.php +++ b/tests/TestCase/View/Widget/DateTimeWidgetTest.php @@ -55,7 +55,7 @@ public function testRenderSimple($compareFileName, $data) * * @return array */ - public function renderProvider() + public static function renderProvider() { return [ [