/** * Should be able to remove a page by giving position * */ public function testShouldBeAbleToRemovePageByPosition() { $nav = new Zym_Navigation(array(array('label' => 'Page 1', 'uri' => '#'), array('label' => 'Page 2', 'uri' => '#', 'position' => 32), array('label' => 'Page 3', 'uri' => '#'), array('label' => 'Page 4', 'uri' => '#'))); $this->assertEquals(true, $nav->removePage(0)); $this->assertEquals(true, $nav->removePage(32)); $this->assertEquals(true, $nav->removePage(0)); $this->assertEquals(false, $nav->removePage(1000)); if ($nav->count() != 1) { $this->fail(4 - $nav->count() . ' pages removed, expected 3'); } elseif ($nav->current()->getLabel() != 'Page 4') { $this->fail('Removed page that should not be removed'); } }