3 class HTMLPurifier_TokenTest
extends HTMLPurifier_Harness
6 protected function assertTokenConstruction($name, $attr,
7 $expect_name = null, $expect_attr = null
9 if ($expect_name === null) $expect_name = $name;
10 if ($expect_attr === null) $expect_attr = $attr;
11 $token = new HTMLPurifier_Token_Start($name, $attr);
13 $this->assertIdentical($expect_name, $token->name
);
14 $this->assertIdentical($expect_attr, $token->attr
);
17 public function testConstruct()
20 $this->assertTokenConstruction('a', array('href' => 'about:blank'));
22 // lowercase the tag's name
23 $this->assertTokenConstruction('A', array('href' => 'about:blank'),
26 // lowercase attributes
27 $this->assertTokenConstruction('a', array('HREF' => 'about:blank'),
28 'a', array('href' => 'about:blank'));