예제 #1
0
 /**
  * Tests:
  *  1. the prepend() method is chainable
  *  2. prepend() adds to the items list
  *  3. prepend() adds an Hubzero\Pathway\Item object to the items list
  *  4. prepend() adds to the BEGINNING of the items list
  *
  * @return  void
  **/
 public function testPrepend()
 {
     $pathway = new Trail();
     $this->assertInstanceOf('Hubzero\\Pathway\\Trail', $pathway->prepend('Crumb 1', 'index.php?option=com_lorem'));
     $this->assertCount(1, $pathway->items(), 'List of crumbs should have returned one Item');
     $name = 'Crumb 2';
     $link = 'index.php?option=com_ipsum';
     $pathway->prepend($name, $link);
     $items = $pathway->items();
     $item = array_shift($items);
     $this->assertInstanceOf('Hubzero\\Pathway\\Item', $item);
     $this->assertEquals($item->name, $name);
     $this->assertEquals($item->link, $link);
 }