Skip to content
Permalink
Browse files

returns an empty string with no crumbs

  • Loading branch information...
mirko-pagliai committed Nov 26, 2016
1 parent dc14d47 commit 80ef05afe4bb60873b59266d79585a68988acff3
Showing with 4 additions and 4 deletions.
  1. +3 −3 src/View/Helper/BreadcrumbsHelper.php
  2. +1 −1 tests/TestCase/View/Helper/BreadcrumbsHelperTest.php
@@ -235,12 +235,12 @@ public function getCrumbs()
* - *innerAttrs* To provide attributes in case your separator is divided in two elements.
* All other properties will be converted as HTML attributes and will replace the *attrs* key in the template.
* If you use the default for this option (empty), it will not render a separator.
* @return string|null The breadcrumbs trail
* @return string The breadcrumbs trail
*/
public function render(array $attributes = [], array $separator = [])
{
if (empty($this->crumbs)) {
return null;
if (!$this->crumbs) {
return '';
}
$crumbs = $this->crumbs;
@@ -357,7 +357,7 @@ public function testInsertAfter()
*/
public function testRender()
{
$this->assertEmpty($this->breadcrumbs->render());
$this->assertSame('', $this->breadcrumbs->render());
$this->breadcrumbs
->add('Home', '/', ['class' => 'first', 'innerAttrs' => ['data-foo' => 'bar']])

0 comments on commit 80ef05a

Please sign in to comment.
You can’t perform that action at this time.