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