public function testPopulateWithRootItem()
 {
     $rootItem = new \Greengrape\Navigation\Item('foo', 'foo/', '/momo/meme/');
     $collection = new Collection('_testContent', '/momo/meme/', $rootItem);
     $items = $collection->toArray();
     $this->assertTrue($items[0] instanceof \Greengrape\Navigation\Item);
     $this->assertEquals('Sub1', $items[0]->getText());
     $this->assertTrue($items[1] instanceof \Greengrape\Navigation\Item);
     $this->assertEquals('Sub2', $items[1]->getText());
 }
Beispiel #2
0
 public function testGetSubNavigation()
 {
     $collection = new Collection('t1', '/baseurl');
     $items = array();
     $items[] = new Item('text1', 'text1/');
     $items[] = new Item('text2', 'text2/');
     $collection->addItems($items);
     $this->_object->setSubNavigationItems($collection);
     $this->assertEquals('/baseurl/text1//baseurl/text2/', $this->_object->getSubNavigation());
 }