3 class HTMLPurifier_ZipperTest
extends HTMLPurifier_Harness
5 public function testBasicNavigation() {
6 list($z, $t) = HTMLPurifier_Zipper
::fromArray(array(0,1,2,3));
7 $this->assertIdentical($t, 0);
9 $this->assertIdentical($t, 1);
11 $this->assertIdentical($t, 0);
12 $t = $z->advance($t, 2);
13 $this->assertIdentical($t, 2);
15 $this->assertIdentical($t, 3);
18 $this->assertIdentical($z->toArray($t), array(0,1,4,3,5));
19 list($old, $t) = $z->splice($t, 2, array(6,7));
20 $this->assertIdentical($old, array(3,5));
21 $this->assertIdentical($t, 6);
22 $this->assertIdentical($z->toArray($t), array(0,1,4,6,7));
25 // ToDo: QuickCheck style test comparing with array_splice