@@ 101-107 (lines=7) @@ | ||
98 | /** |
|
99 | * tests undo |
|
100 | */ |
|
101 | public function testUndo(): void |
|
102 | { |
|
103 | $this->undoStack->add('first'); |
|
104 | $this->undoStack->add('second'); |
|
105 | self::assertTrue($this->undoStack->undo()); |
|
106 | self::assertEquals('first', $this->undoStack->getCurrentItem()); |
|
107 | } |
|
108 | ||
109 | /** |
|
110 | * tests undo() to return false when nothing can be undone |
|
@@ 137-144 (lines=8) @@ | ||
134 | /** |
|
135 | * tests redo() |
|
136 | */ |
|
137 | public function testRedo(): void |
|
138 | { |
|
139 | $this->undoStack->add('first'); |
|
140 | $this->undoStack->add('second'); |
|
141 | self::assertTrue($this->undoStack->undo()); |
|
142 | self::assertTrue($this->undoStack->redo()); |
|
143 | self::assertEquals('second', $this->undoStack->getCurrentItem()); |
|
144 | } |
|
145 | ||
146 | /** |
|
147 | * tests add(), removing future values |
|
@@ 180-187 (lines=8) @@ | ||
177 | /** |
|
178 | * tests duplicate entries avoiding |
|
179 | */ |
|
180 | public function testAvoidDuplicateEntries(): void |
|
181 | { |
|
182 | $this->undoStack->add('first'); |
|
183 | $this->undoStack->add('second'); |
|
184 | $this->undoStack->add('second'); |
|
185 | self::assertTrue($this->undoStack->undo()); |
|
186 | self::assertSame('first', $this->undoStack->getCurrentItem()); |
|
187 | } |
|
188 | ||
189 | /** |
|
190 | * tests a complex sequence |