@@ 106-121 (lines=16) @@ | ||
103 | $this->assertNull($this->list->shift()); |
|
104 | } |
|
105 | ||
106 | public function testPop() { |
|
107 | $this->list->push(20); |
|
108 | $this->list->push(true); |
|
109 | $this->list->push(15); |
|
110 | $this->list->push(3.14); |
|
111 | $this->list->push("string"); |
|
112 | ||
113 | $this->assertEquals($this->list->pop(), "string"); |
|
114 | $this->assertEquals(3.14, $this->list->pop()); |
|
115 | $this->list->insert(1, ['hello']); |
|
116 | $this->assertEquals(15, $this->list->pop()); |
|
117 | $this->assertTrue($this->list->pop()); |
|
118 | $this->assertSame($this->list->pop(), ['hello']); |
|
119 | $this->assertSame($this->list->pop(), 20); |
|
120 | $this->assertTrue($this->list->empty()); |
|
121 | } |
|
122 | ||
123 | public function testPopException() { |
|
124 | $this->expectException(\OutOfBoundsException::class); |
@@ 106-121 (lines=16) @@ | ||
103 | $this->assertNull($this->list->shift()); |
|
104 | } |
|
105 | ||
106 | public function testPop() { |
|
107 | $this->list->push(20); |
|
108 | $this->list->push(true); |
|
109 | $this->list->push(15); |
|
110 | $this->list->push(3.14); |
|
111 | $this->list->push("string"); |
|
112 | ||
113 | $this->assertEquals($this->list->pop(), "string"); |
|
114 | $this->assertEquals(3.14, $this->list->pop()); |
|
115 | $this->list->insert(1, ['hello']); |
|
116 | $this->assertEquals(15, $this->list->pop()); |
|
117 | $this->assertTrue($this->list->pop()); |
|
118 | $this->assertSame($this->list->pop(), ['hello']); |
|
119 | $this->assertSame($this->list->pop(), 20); |
|
120 | $this->assertTrue($this->list->empty()); |
|
121 | } |
|
122 | ||
123 | public function testPopException() { |
|
124 | $this->expectException(\OutOfBoundsException::class); |