'file', 'q' => 'quiet', ); htmlpurifier_parse_args($AC, $aliases); if ($AC['xml']) { $reporter = new XmlReporter(); } else { $reporter = new TextReporter(); } // Regenerate any necessary files htmlpurifier_flush($AC['php'], $reporter); $file = ''; $test_files = array(); require 'test_files.php'; if ($AC['file']) { $test_files_lookup = array_flip($test_files); if (isset($test_files_lookup[$AC['file']])) { $file = '--file=' . $AC['file']; } else { throw new Exception("Invalid file passed"); } } // This allows us to get out of having to do dry runs. $size = count($test_files); // Setup the test $test = new TestSuite('HTML Purifier Multiple Versions Test'); foreach ($versions_to_test as $version) { $flush = ''; if (is_array($version)) { $version = $version[0]; $flush = '--flush'; } if (!$AC['only-phpt']) { if (!$AC['exclude-normal']) { $test->add( new CliTestCase( "$phpv $version index.php --xml $flush --disable-phpt $file", $AC['quiet'], $size ) ); } if (!$AC['exclude-standalone']) { $test->add( new CliTestCase( "$phpv $version index.php --xml $flush --standalone --disable-phpt $file", $AC['quiet'], $size ) ); } } if (!$AC['disable-phpt']) { // naming is not consistent $test->add( new CliTestCase( $AC['php'] . " index.php --xml --php \"$phpv $version\" --only-phpt", $AC['quiet'], $size ) ); } } // This is the HTML Purifier website's test XML file. We could // add more websites, i.e. more configurations to test. // $test->add(new RemoteTestCase('http://htmlpurifier.org/dev/tests/?xml=1', 'http://htmlpurifier.org/dev/tests/?xml=1&dry=1&flush=1')); $test->run($reporter);