Exemplo n.º 1
0
 public function testArrayConstruction()
 {
     $list = new LinkedList($this->exampleSet);
     foreach ($list as $l) {
         if ($list->isFirst()) {
             $this->assertEquals($this->first, $l);
             break;
         }
     }
     return $list;
 }
Exemplo n.º 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;
 }