Add %HTML.TargetNoreferrer, which adds rel="noreferrer" when target attribute is set
[htmlpurifier.git] / tests / HTMLPurifier / ZipperTest.php
blob50c3f04cd81d4dd0e719583e42a35419adbfeb39
1 <?php
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);
8 $t = $z->next($t);
9 $this->assertIdentical($t, 1);
10 $t = $z->prev($t);
11 $this->assertIdentical($t, 0);
12 $t = $z->advance($t, 2);
13 $this->assertIdentical($t, 2);
14 $t = $z->delete();
15 $this->assertIdentical($t, 3);
16 $z->insertBefore(4);
17 $z->insertAfter(5);
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