@@ 126-142 (lines=17) @@ | ||
123 | $this->list->pop(); |
|
124 | } |
|
125 | ||
126 | public function testUnshift() { |
|
127 | $this->list->unshift(999); |
|
128 | $this->assertEquals(1, $this->list->size()); |
|
129 | $this->assertEquals(999, $this->list->get(0)); |
|
130 | $this->assertEquals($this->list->getLast(), 999); |
|
131 | $this->list->unshift(888); |
|
132 | $this->assertEquals(2, $this->list->size()); |
|
133 | $this->assertEquals(888, $this->list->get(0)); |
|
134 | $this->assertEquals(999, $this->list->get(1)); |
|
135 | $this->assertEquals($this->list->getLast(), 999); |
|
136 | $this->list->unshift(777); |
|
137 | $this->assertEquals(3, $this->list->size()); |
|
138 | $this->assertEquals(777, $this->list->get(0)); |
|
139 | $this->assertEquals(888, $this->list->get(1)); |
|
140 | $this->assertEquals(999, $this->list->get(2)); |
|
141 | $this->assertEquals($this->list->getLast(), 999); |
|
142 | } |
|
143 | ||
144 | public function testGet() { |
|
145 | $this->list->push(20); |
@@ 124-140 (lines=17) @@ | ||
121 | $this->list->pop(); |
|
122 | } |
|
123 | ||
124 | public function testUnshift() { |
|
125 | $this->list->unshift(999); |
|
126 | $this->assertEquals(1, $this->list->size()); |
|
127 | $this->assertEquals(999, $this->list->get(0)); |
|
128 | $this->assertEquals($this->list->getLast(), 999); |
|
129 | $this->list->unshift(888); |
|
130 | $this->assertEquals(2, $this->list->size()); |
|
131 | $this->assertEquals(888, $this->list->get(0)); |
|
132 | $this->assertEquals(999, $this->list->get(1)); |
|
133 | $this->assertEquals($this->list->getLast(), 999); |
|
134 | $this->list->unshift(777); |
|
135 | $this->assertEquals(3, $this->list->size()); |
|
136 | $this->assertEquals(777, $this->list->get(0)); |
|
137 | $this->assertEquals(888, $this->list->get(1)); |
|
138 | $this->assertEquals(999, $this->list->get(2)); |
|
139 | $this->assertEquals($this->list->getLast(), 999); |
|
140 | } |
|
141 | ||
142 | public function testGet() { |
|
143 | $this->list->push(20); |
@@ 126-142 (lines=17) @@ | ||
123 | $this->list->pop(); |
|
124 | } |
|
125 | ||
126 | public function testUnshift() { |
|
127 | $this->list->unshift(999); |
|
128 | $this->assertEquals(1, $this->list->size()); |
|
129 | $this->assertEquals(999, $this->list->get(0)); |
|
130 | $this->assertEquals($this->list->getLast(), 999); |
|
131 | $this->list->unshift(888); |
|
132 | $this->assertEquals(2, $this->list->size()); |
|
133 | $this->assertEquals(888, $this->list->get(0)); |
|
134 | $this->assertEquals(999, $this->list->get(1)); |
|
135 | $this->assertEquals($this->list->getLast(), 999); |
|
136 | $this->list->unshift(777); |
|
137 | $this->assertEquals(3, $this->list->size()); |
|
138 | $this->assertEquals(777, $this->list->get(0)); |
|
139 | $this->assertEquals(888, $this->list->get(1)); |
|
140 | $this->assertEquals(999, $this->list->get(2)); |
|
141 | $this->assertEquals($this->list->getLast(), 999); |
|
142 | } |
|
143 | ||
144 | public function testGet() { |
|
145 | $this->list->push(20); |