Skip to content

Commit 7d7c919

Browse files
authored
Merge pull request #986 from cakephp/2.x-assert-nick
[2.x] Correct asserted view code
2 parents f90d514 + b4167f8 commit 7d7c919

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

tests/TestCase/Command/TemplateCommandTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,11 @@ public function testGetContentWithRoutingPrefix()
439439
*/
440440
public function testBakeView()
441441
{
442+
if (version_compare(Configure::version(), '4.5.0', '<')) {
443+
$this->markTestSkipped(
444+
'CakePHP versions older than 4.5.0 will generate `$author->profile->nick` instead of `$author->profile->id`'
445+
);
446+
}
442447
$this->generatedFile = ROOT . 'templates/Authors/view.php';
443448
$this->exec('bake template authors view');
444449

tests/comparisons/Template/testBakeView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</tr>
2929
<tr>
3030
<th><?= __('Profile') ?></th>
31-
<td><?= $author->has('profile') ? $this->Html->link($author->profile->id, ['controller' => 'Profiles', 'action' => 'view', $author->profile->id]) : '' ?></td>
31+
<td><?= $author->has('profile') ? $this->Html->link($author->profile->nick, ['controller' => 'Profiles', 'action' => 'view', $author->profile->id]) : '' ?></td>
3232
</tr>
3333
<tr>
3434
<th><?= __('Id') ?></th>

0 commit comments

Comments
 (0)