Rewrite CSS url() and font-family output logic.
[htmlpurifier.git] / tests / HTMLPurifier / AttrDef / CSS / FontFamilyTest.php
blobaff105285a7afa5e7295947dbef519b1a8e6c7f4
1 <?php
3 class HTMLPurifier_AttrDef_CSS_FontFamilyTest extends HTMLPurifier_AttrDefHarness
6 function test() {
8 $this->def = new HTMLPurifier_AttrDef_CSS_FontFamily();
10 $this->assertDef('Gill, Helvetica, sans-serif');
11 $this->assertDef('"Times New Roman", serif');
12 $this->assertDef('\'Times New Roman\'', '"Times New Roman"');
13 $this->assertDef('01234');
14 $this->assertDef(',', false);
15 $this->assertDef('Times New Roman, serif', '"Times New Roman", serif');
16 $this->assertDef($d = '"John\'s Font"');
17 $this->assertDef("John's Font", $d);
18 $this->assertDef($d = "\"\xE5\xAE\x8B\xE4\xBD\x93\"");
19 $this->assertDef("\xE5\xAE\x8B\xE4\xBD\x93", $d);
20 $this->assertDef("'\\','f'", "\"\\5C \", f");
21 $this->assertDef("'\\01'", "\"\"");
22 $this->assertDef("'\\20'", "\" \"");
23 $this->assertDef("\\0020", "\" \"");
24 $this->assertDef("'\\000045'", "E");
25 $this->assertDef("','", false);
26 $this->assertDef("',' foobar','", "\" foobar\"");
27 $this->assertDef("'\\27'", "\"'\"");
28 $this->assertDef('"\\22"', "\"\\22 \"");
29 $this->assertDef('"\\""', "\"\\22 \"");
30 $this->assertDef('"\'"', "\"'\"");
31 $this->assertDef("'\\000045a'", "Ea");
32 $this->assertDef("'\\00045 a'", "Ea");
33 $this->assertDef("'\\00045 a'", "\"E a\"");
34 $this->assertDef("'\\\nf'", "f");
39 // vim: et sw=4 sts=4