Improve auto-paragraph to preserve newlines and handle edge-cases better.
[htmlpurifier.git] / tests / HTMLPurifier / TokenTest.php
blob49904b5f0dddadd18c77985f1d21a1ca8866359c
1 <?php
3 class HTMLPurifier_TokenTest extends HTMLPurifier_Harness
6 protected function assertTokenConstruction($name, $attr,
7 $expect_name = null, $expect_attr = null
8 ) {
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 function testConstruct() {
19 // standard case
20 $this->assertTokenConstruction('a', array('href' => 'about:blank'));
22 // lowercase the tag's name
23 $this->assertTokenConstruction('A', array('href' => 'about:blank'),
24 'a');
26 // lowercase attributes
27 $this->assertTokenConstruction('a', array('HREF' => 'about:blank'),
28 'a', array('href' => 'about:blank'));