From 70e0b3462ff18267792e6463a545c88f6610f3c1 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 1 Jun 2024 00:13:57 -0400 Subject: [PATCH] Update fixtures, fix formatting --- src/View/Helper/BakeHelper.php | 2 +- .../Template/testBakeIndexWithEnumNoLabel.php | 48 ++++++++++++ .../testBakeIndexWithEnumWithLabel.php | 50 +++++++++++++ .../comparisons/Template/testBakeViewEnum.php | 2 +- .../Template/testBakeViewEnumNoLabel.php | 75 +++++++++++++++++++ 5 files changed, 175 insertions(+), 2 deletions(-) diff --git a/src/View/Helper/BakeHelper.php b/src/View/Helper/BakeHelper.php index 2cdf62209..431405b32 100644 --- a/src/View/Helper/BakeHelper.php +++ b/src/View/Helper/BakeHelper.php @@ -9,9 +9,9 @@ use Cake\Core\Configure; use Cake\Core\ConventionsTrait; use Cake\Database\Schema\TableSchema; +use Cake\Database\Type\EnumType; use Cake\Database\TypeFactory; use Cake\Datasource\SchemaInterface; -use Cake\Database\Type\EnumType; use Cake\ORM\Table; use Cake\Utility\Inflector; use Cake\View\Helper; diff --git a/tests/comparisons/Template/testBakeIndexWithEnumNoLabel.php b/tests/comparisons/Template/testBakeIndexWithEnumNoLabel.php index e69de29bb..8f3ee6d15 100644 --- a/tests/comparisons/Template/testBakeIndexWithEnumNoLabel.php +++ b/tests/comparisons/Template/testBakeIndexWithEnumNoLabel.php @@ -0,0 +1,48 @@ + $articles + */ +?> +
+ Html->link(__('New Article'), ['action' => 'add'], ['class' => 'button float-right']) ?> +

+
+ + + + + + + + + + + + + + + + + + + + + +
Paginator->sort('id') ?>Paginator->sort('author_id') ?>Paginator->sort('title') ?>Paginator->sort('published') ?>
Number->format($article->id) ?>hasValue('author') ? $this->Html->link($article->author->name, ['controller' => 'Authors', 'action' => 'view', $article->author->id]) : '' ?>title) ?>published === null ? '' : h($article->published->value) ?> + Html->link(__('View'), ['action' => 'view', $article->id]) ?> + Html->link(__('Edit'), ['action' => 'edit', $article->id]) ?> + Form->postLink(__('Delete'), ['action' => 'delete', $article->id], ['confirm' => __('Are you sure you want to delete # {0}?', $article->id)]) ?> +
+
+
+
    + Paginator->first('<< ' . __('first')) ?> + Paginator->prev('< ' . __('previous')) ?> + Paginator->numbers() ?> + Paginator->next(__('next') . ' >') ?> + Paginator->last(__('last') . ' >>') ?> +
+

Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?>

+
+
\ No newline at end of file diff --git a/tests/comparisons/Template/testBakeIndexWithEnumWithLabel.php b/tests/comparisons/Template/testBakeIndexWithEnumWithLabel.php index e69de29bb..b5b497452 100644 --- a/tests/comparisons/Template/testBakeIndexWithEnumWithLabel.php +++ b/tests/comparisons/Template/testBakeIndexWithEnumWithLabel.php @@ -0,0 +1,50 @@ + $bakeUsers + */ +?> +
+ Html->link(__('New Bake User'), ['action' => 'add'], ['class' => 'button float-right']) ?> +

+
+ + + + + + + + + + + + + + + + + + + + + + + +
Paginator->sort('id') ?>Paginator->sort('username') ?>Paginator->sort('status') ?>Paginator->sort('created') ?>Paginator->sort('updated') ?>
Number->format($bakeUser->id) ?>username) ?>status === null ? '' : h($bakeUser->status->label()) ?>created) ?>updated) ?> + Html->link(__('View'), ['action' => 'view', $bakeUser->id]) ?> + Html->link(__('Edit'), ['action' => 'edit', $bakeUser->id]) ?> + Form->postLink(__('Delete'), ['action' => 'delete', $bakeUser->id], ['confirm' => __('Are you sure you want to delete # {0}?', $bakeUser->id)]) ?> +
+
+
+
    + Paginator->first('<< ' . __('first')) ?> + Paginator->prev('< ' . __('previous')) ?> + Paginator->numbers() ?> + Paginator->next(__('next') . ' >') ?> + Paginator->last(__('last') . ' >>') ?> +
+

Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?>

+
+
\ No newline at end of file diff --git a/tests/comparisons/Template/testBakeViewEnum.php b/tests/comparisons/Template/testBakeViewEnum.php index 49391e452..4cae270bd 100644 --- a/tests/comparisons/Template/testBakeViewEnum.php +++ b/tests/comparisons/Template/testBakeViewEnum.php @@ -28,7 +28,7 @@ - status === null ? '' : $this->Number->format($bakeUser->status) ?> + status === null ? '' : h($bakeUser->status->label()) ?> diff --git a/tests/comparisons/Template/testBakeViewEnumNoLabel.php b/tests/comparisons/Template/testBakeViewEnumNoLabel.php index e69de29bb..e5e0fd4b9 100644 --- a/tests/comparisons/Template/testBakeViewEnumNoLabel.php +++ b/tests/comparisons/Template/testBakeViewEnumNoLabel.php @@ -0,0 +1,75 @@ + +
+ +
+
+

title) ?>

+ + + + + + + + + + + + + + + + + +
hasValue('author') ? $this->Html->link($article->author->name, ['controller' => 'Authors', 'action' => 'view', $article->author->id]) : '' ?>
title) ?>
Number->format($article->id) ?>
published === null ? '' : h($article->published->value) ?>
+
+ +
+ Text->autoParagraph(h($article->body)); ?> +
+
+ +
+
+
\ No newline at end of file