diff --git a/src/View/Helper/BakeHelper.php b/src/View/Helper/BakeHelper.php index d45131a49..51d639a05 100644 --- a/src/View/Helper/BakeHelper.php +++ b/src/View/Helper/BakeHelper.php @@ -78,7 +78,19 @@ public function stringifyList(array $list, array $options = []) $v = "'$v'"; } if (!is_numeric($k)) { - $v = "'$k' => $v"; + $nestedOptions = $options; + if ($nestedOptions['indent']) { + $nestedOptions['indent'] += 1; + } + if (is_array($v)) { + $v = sprintf( + "'%s' => [%s]", + $k, + $this->stringifyList($v, $nestedOptions) + ); + } else { + $v = "'$k' => $v"; + } } } diff --git a/tests/TestCase/Shell/Task/ModelTaskTest.php b/tests/TestCase/Shell/Task/ModelTaskTest.php index ae0144c88..7cbf2f833 100644 --- a/tests/TestCase/Shell/Task/ModelTaskTest.php +++ b/tests/TestCase/Shell/Task/ModelTaskTest.php @@ -1042,7 +1042,8 @@ public function testGetBehaviors() $behaviors = $this->Task->getBehaviors($model); $behaviors['Translate'] = [ - 'defaultLocale' => "'fr_FR'" + 'defaultLocale' => "'fr_FR'", + 'implementedFinders' => ['translations' => "'findTranslations'"], ]; $result = $this->Task->bakeTable($model, ['behaviors' => $behaviors]); diff --git a/tests/comparisons/Model/testGetBehaviors.php b/tests/comparisons/Model/testGetBehaviors.php index 014269f79..7f80c3e2e 100644 --- a/tests/comparisons/Model/testGetBehaviors.php +++ b/tests/comparisons/Model/testGetBehaviors.php @@ -39,7 +39,10 @@ public function initialize(array $config) 'Users' => ['post_count'] ]); $this->addBehavior('Translate', [ - 'defaultLocale' => 'fr_FR' + 'defaultLocale' => 'fr_FR', + 'implementedFinders' => [ + 'translations' => 'findTranslations' + ] ]); }