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'); 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]) : '' ?>