| @@ 61-72 (lines=12) @@ | ||
| 58 | $this->assertEquals(3, $this->tree->wordCount()); |
|
| 59 | } |
|
| 60 | ||
| 61 | public function testDelete() { |
|
| 62 | $this->tree->add('hellou'); |
|
| 63 | $this->tree->add('hell'); |
|
| 64 | $this->tree->add('yellow'); |
|
| 65 | $this->tree->delete('hellou'); |
|
| 66 | $this->assertEquals(2, $this->tree->wordCount()); |
|
| 67 | $this->assertFalse($this->tree->contains('hellou')); |
|
| 68 | $this->assertTrue($this->tree->contains('hell')); |
|
| 69 | $this->assertTrue($this->tree->contains('yellow')); |
|
| 70 | $this->tree->delete('yellow'); |
|
| 71 | $this->assertEquals(4, $this->tree->size()); |
|
| 72 | } |
|
| 73 | ||
| 74 | public function testClear() { |
|
| 75 | $this->tree->add('hellou'); |
|
| @@ 74-85 (lines=12) @@ | ||
| 71 | $this->assertEquals(4, $this->tree->size()); |
|
| 72 | } |
|
| 73 | ||
| 74 | public function testClear() { |
|
| 75 | $this->tree->add('hellou'); |
|
| 76 | $this->tree->add('hell'); |
|
| 77 | $this->tree->add('yellow'); |
|
| 78 | $this->assertEquals(3, $this->tree->wordCount()); |
|
| 79 | $this->tree->clear(); |
|
| 80 | var_dump($this->tree); |
|
| 81 | $this->assertFalse($this->tree->contains('hellou')); |
|
| 82 | $this->assertFalse($this->tree->contains('hell')); |
|
| 83 | $this->assertFalse($this->tree->contains('yellow')); |
|
| 84 | $this->assertEquals(0, $this->tree->size()); |
|
| 85 | } |
|
| 86 | } |
|