| @@ 72-83 (lines=12) @@ | ||
| 69 | $this->assertEquals($this->queue->size(), 5); |
|
| 70 | } |
|
| 71 | ||
| 72 | public function testEmpty() { |
|
| 73 | $this->queue = new Queue(); |
|
| 74 | $this->assertTrue($this->queue->empty()); |
|
| 75 | $this->queue->enqueue(true); |
|
| 76 | $this->assertFalse($this->queue->empty()); |
|
| 77 | $this->queue->enqueue("string"); |
|
| 78 | $this->queue->enqueue(3.14); |
|
| 79 | $this->queue->dequeue(); |
|
| 80 | $this->queue->dequeue(); |
|
| 81 | $this->queue->dequeue(); |
|
| 82 | $this->assertTrue($this->queue->empty()); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testPeek() { |
|
| 86 | $this->queue = new Queue(); |
|
| @@ 82-93 (lines=12) @@ | ||
| 79 | $this->assertEquals($this->stack->size(), 5); |
|
| 80 | } |
|
| 81 | ||
| 82 | public function testEmpty() { |
|
| 83 | $this->stack = new Stack(); |
|
| 84 | $this->assertTrue($this->stack->empty()); |
|
| 85 | $this->stack->push(true); |
|
| 86 | $this->assertFalse($this->stack->empty()); |
|
| 87 | $this->stack->push("string"); |
|
| 88 | $this->stack->push(3.14); |
|
| 89 | $this->stack->pop(); |
|
| 90 | $this->stack->pop(); |
|
| 91 | $this->stack->pop(); |
|
| 92 | $this->assertTrue($this->stack->empty()); |
|
| 93 | } |
|
| 94 | ||
| 95 | public function testPeek() { |
|
| 96 | $this->stack = new Stack(); |
|