Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/AbstractContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ public function addPages($pages)
}

foreach ($pages as $page) {
if (null === $page) {
continue;
}
$this->addPage($page);
}

Expand Down
17 changes: 17 additions & 0 deletions test/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,23 @@ public function testConstructorShouldThrowExceptionOnInvalidArgument()
}
}

/**
* @group 3823
* @group 3840
*/
public function testAddPagesWithNullValueSkipsPage()
{
$nav = new Navigation\Navigation(array(
array(
'label' => 'Page 1',
'uri' => '#'
),
null
));
$count = count($nav->getPages());
$this->assertEquals(1, $count);
}

public function testIterationShouldBeOrderAware()
{
$nav = new Navigation\Navigation(array(
Expand Down

0 comments on commit b31816b

Please sign in to comment.