public function testListAll()
 {
     $firstData = $this->generateData();
     $secondData = $this->generateData();
     $this->doubleLinkedList->push($firstData);
     $this->doubleLinkedList->push($secondData);
     $dataArray = [$firstData, $secondData];
     $this->assertTrue($this->doubleLinkedList->listAll() == $dataArray);
 }
Beispiel #2
0
 /**
  *
  */
 public function setup()
 {
     $this->doubleLinkedList = new DoubleLinkedList();
     $this->values = [8, 6, 5, 9, 1, 12, 2, 10, 4, 11, 3, 13];
     $this->sorted = [1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13];
     foreach ($this->values as $value) {
         $this->doubleLinkedList->push($value);
     }
     $this->sortable = new Sortable();
 }