Rewrite CSS url() and font-family output logic.
[htmlpurifier.git] / tests / HTMLPurifier / HTMLT.php
blob06e7958fb7355c0b18c3f6fc256211135c999988
1 <?php
3 class HTMLPurifier_HTMLT extends HTMLPurifier_Harness
5 protected $path;
7 public function __construct($path) {
8 $this->path = $path;
9 parent::__construct($path);
12 public function testHtmlt() {
13 $parser = new HTMLPurifier_StringHashParser();
14 $hash = $parser->parseFile($this->path); // assume parser normalizes to "\n"
15 if (isset($hash['SKIPIF'])) {
16 if (eval($hash['SKIPIF'])) return;
18 $this->config->set('Output.Newline', "\n");
19 if (isset($hash['INI'])) {
20 // there should be a more efficient way than writing another
21 // ini file every time... probably means building a parser for
22 // ini (check out the yaml implementation we saw somewhere else)
23 $ini_file = $this->path . '.ini';
24 file_put_contents($ini_file, $hash['INI']);
25 $this->config->loadIni($ini_file);
27 $expect = isset($hash['EXPECT']) ? $hash['EXPECT'] : $hash['HTML'];
28 $this->assertPurification(rtrim($hash['HTML']), rtrim($expect));
29 if (isset($hash['INI'])) unlink($ini_file);
33 // vim: et sw=4 sts=4