public function testFirstMethod()
 {
     $list = new LinkedList();
     $list->add($this->first);
     for ($list->rewind(); $list->valid(); $list->next()) {
         $this->assertTrue($list->isFirst());
         break;
     }
     return $list;
 }
Exemple #2
0
 /**
  * Overrides the parent method by enforcing a type on the parameter,
  * making a type-safe list
  *
  * @param \Flat\Post
  *      An instance of the Post object
  * @return bool
  *      True if the Post object was added to the list
  */
 public function add(Post $post)
 {
     parent::add($post);
     return true;
 }