Skip to content

Loading…

allow a null page in pages array, to compensate for ZF issue #3823 #3840

Closed
wants to merge 2 commits into from

4 participants

@nclundsten

No description provided.

@Freeaqingme Freeaqingme commented on the diff
tests/ZendTest/Navigation/ContainerTest.php
@@ -114,6 +114,19 @@ public function testConstructorShouldThrowExceptionOnInvalidArgument()
}
}
+ public function testAddPagesWithNullValueSkipsPage()
@Freeaqingme Zend Framework member

Could you please at a @group annotation docblock that refers to this issue and to #3823? That'll allow people to later reference what issue this test actually tests for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Freeaqingme
Zend Framework member

1 small comment. Otherwise good to go.

@weierophinney weierophinney added a commit that referenced this pull request
@weierophinney weierophinney [#3840] Added group annotations to new test
- per comment from @Freeaqingme
cc8d0ad
@weierophinney weierophinney added a commit that referenced this pull request
@weierophinney weierophinney Merge branch 'hotfix/3840' into develop
Forward port #3840
39ee993
@weierophinney weierophinney added a commit that closed this pull request
@weierophinney weierophinney Merge branch 'hotfix/3840'
Close #3840
Fixes #3823
f748117
@curious-eyes curious-eyes added a commit to curious-eyes/zf2 that referenced this pull request
@weierophinney weierophinney [#3840] Added group annotations to new test
- per comment from @Freeaqingme
bd4f443
@ghost Unknown pushed a commit that referenced this pull request
@weierophinney weierophinney [#3840] Added group annotations to new test
- per comment from @Freeaqingme
d892236
@ghost Unknown pushed a commit that referenced this pull request
@weierophinney weierophinney Merge branch 'hotfix/3840'
Close #3840
Fixes #3823
1e86866
@ghost Unknown pushed a commit that referenced this pull request
@weierophinney weierophinney Merge branch 'hotfix/3840' into develop
Forward port #3840
f9794c6
@weierophinney weierophinney added a commit to zendframework/zend-navigation that referenced this pull request
@weierophinney weierophinney [zendframework/zf2#3840] Added group annotations to new test
- per comment from @Freeaqingme
73dac83
@weierophinney weierophinney added a commit to zendframework/zend-navigation that referenced this pull request
@weierophinney weierophinney Merge branch 'hotfix/3840' 361c1cf
@weierophinney weierophinney added a commit to zendframework/zend-navigation that referenced this pull request
@weierophinney weierophinney Merge branch 'hotfix/3840' into develop c22ee86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 20, 2013
  1. add unit test

    nigel lundsten committed
Showing with 16 additions and 0 deletions.
  1. +3 −0 library/Zend/Navigation/AbstractContainer.php
  2. +13 −0 tests/ZendTest/Navigation/ContainerTest.php
View
3 library/Zend/Navigation/AbstractContainer.php
@@ -159,6 +159,9 @@ public function addPages($pages)
}
foreach ($pages as $page) {
+ if (null === $page) {
+ continue;
+ }
$this->addPage($page);
}
View
13 tests/ZendTest/Navigation/ContainerTest.php
@@ -114,6 +114,19 @@ public function testConstructorShouldThrowExceptionOnInvalidArgument()
}
}
+ public function testAddPagesWithNullValueSkipsPage()
@Freeaqingme Zend Framework member

Could you please at a @group annotation docblock that refers to this issue and to #3823? That'll allow people to later reference what issue this test actually tests for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ {
+ $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(
Something went wrong with that request. Please try again.