From aaa021ab717c3e45821a844ff14fccc864f1e353 Mon Sep 17 00:00:00 2001 From: "marc.wuerth" Date: Fri, 26 Apr 2024 13:06:30 +0200 Subject: [PATCH 1/4] Correct asserted view code --- tests/comparisons/Template/testBakeView.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/comparisons/Template/testBakeView.php b/tests/comparisons/Template/testBakeView.php index 87070285..987ea205 100644 --- a/tests/comparisons/Template/testBakeView.php +++ b/tests/comparisons/Template/testBakeView.php @@ -28,7 +28,7 @@ - has('profile') ? $this->Html->link($author->profile->id, ['controller' => 'Profiles', 'action' => 'view', $author->profile->id]) : '' ?> + has('profile') ? $this->Html->link($author->profile->nick, ['controller' => 'Profiles', 'action' => 'view', $author->profile->id]) : '' ?> From b4167f80af5fc974cbe3a07969657b85f3b64cc3 Mon Sep 17 00:00:00 2001 From: "marc.wuerth" Date: Fri, 26 Apr 2024 20:39:18 +0200 Subject: [PATCH 2/4] Skip test case that behaves differently with older CakePHP versions --- tests/TestCase/Command/TemplateCommandTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/TestCase/Command/TemplateCommandTest.php b/tests/TestCase/Command/TemplateCommandTest.php index 192fcf82..3ce5cd52 100644 --- a/tests/TestCase/Command/TemplateCommandTest.php +++ b/tests/TestCase/Command/TemplateCommandTest.php @@ -439,6 +439,11 @@ public function testGetContentWithRoutingPrefix() */ public function testBakeView() { + if (version_compare(Configure::version(), '4.5.0', '<')) { + $this->markTestSkipped( + 'CakePHP versions older than 4.5.0 will generate `$author->profile->nick` instead of `$author->profile->id`' + ); + } $this->generatedFile = ROOT . 'templates/Authors/view.php'; $this->exec('bake template authors view'); From 28783da3e57d6592defdc12c50e30ba128e69c59 Mon Sep 17 00:00:00 2001 From: Kevin Pfeifer Date: Thu, 8 Aug 2024 12:44:41 +0200 Subject: [PATCH 3/4] update stan --- .phive/phars.xml | 4 ++-- phpstan.neon | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.phive/phars.xml b/.phive/phars.xml index 1f56b2bc..726b7777 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,5 +1,5 @@ - - + + diff --git a/phpstan.neon b/phpstan.neon index a1af9249..32434594 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -3,8 +3,9 @@ includes: parameters: level: 6 - checkMissingIterableValueType: false paths: - src/ bootstrapFiles: - tests/bootstrap.php + ignoreErrors: + - identifier: missingType.iterableValue From 46ecd8602d96af6999f423bab7feb0c8e5e8affe Mon Sep 17 00:00:00 2001 From: Kevin Pfeifer Date: Fri, 13 Sep 2024 18:28:11 +0200 Subject: [PATCH 4/4] remove version check in tests --- tests/TestCase/Command/TemplateCommandTest.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/TestCase/Command/TemplateCommandTest.php b/tests/TestCase/Command/TemplateCommandTest.php index d5cbae8e..7c0e47b0 100644 --- a/tests/TestCase/Command/TemplateCommandTest.php +++ b/tests/TestCase/Command/TemplateCommandTest.php @@ -443,11 +443,6 @@ public function testGetContentWithRoutingPrefix() */ public function testBakeView() { - if (version_compare(Configure::version(), '4.5.0', '<')) { - $this->markTestSkipped( - 'CakePHP versions older than 4.5.0 will generate `$author->profile->nick` instead of `$author->profile->id`' - ); - } $this->generatedFile = ROOT . 'templates/Authors/view.php'; $this->exec('bake template authors view');