Browse Source

Fix a custom variable from the separator template and fix the tests

Yves P 9 years ago
parent
commit
fa874c41a8

+ 1 - 1
src/View/Helper/BreadcrumbsHelper.php

@@ -45,7 +45,7 @@ class BreadcrumbsHelper extends Helper
             'wrapper' => '<ul{{attrs}}>{{content}}</ul>',
             'item' => '<li{{attrs}}><a href="{{url}}"{{innerAttrs}}>{{title}}</a></li>{{separator}}',
             'itemWithoutLink' => '<li{{attrs}}><span{{innerAttrs}}>{{title}}</span></li>{{separator}}',
-            'separator' => '<li{{attrs}}><span{{innerAttrs}}>{{custom}}{{separator}}</span></li>'
+            'separator' => '<li{{attrs}}><span{{innerAttrs}}>{{separator}}</span></li>'
         ]
     ];
 

+ 5 - 3
tests/TestCase/View/Helper/BreadcrumbsHelperTest.php

@@ -305,7 +305,7 @@ class BreadcrumbsHelperTest extends TestCase
 
         $result = $this->breadcrumbs->render(
             ['data-stuff' => 'foo and bar'],
-            ['separator' => '<i class="fa fa-angle-right"></i>', 'class' => 'separator', 'templateVars' => ['custom' => 'custom']]
+            ['separator' => '<i class="fa fa-angle-right"></i>', 'class' => 'separator']
         );
         $expected = [
             ['ul' => ['data-stuff' => 'foo and bar']],
@@ -316,7 +316,8 @@ class BreadcrumbsHelperTest extends TestCase
             '/li',
             ['li' => ['class' => 'separator']],
             ['span' => []],
-            'custom<i class="fa fa-angle-right"></i>',
+            ['i' => ['class' => 'fa fa-angle-right']],
+            '/i',
             '/span',
             '/li',
             ['li' => []],
@@ -326,7 +327,8 @@ class BreadcrumbsHelperTest extends TestCase
             '/li',
             ['li' => ['class' => 'separator']],
             ['span' => []],
-            'custom<i class="fa fa-angle-right"></i>',
+            ['i' => ['class' => 'fa fa-angle-right']],
+            '/i',
             '/span',
             '/li',
             ['li' => ['class' => 'final']],