'file', 'q' => 'quiet', ); htmlpurifier_parse_args($AC, $aliases); // Currently not configurable $AC['disable-phpt'] = false; $AC['only-phpt'] = false; // Calls generate-includes.php automatically shell_exec($AC['php'] . ' ../maintenance/merge-library.php'); // Not strictly necessary, but its a good idea shell_exec($AC['php'] . ' ../maintenance/generate-schema-cache.php'); shell_exec($AC['php'] . ' ../maintenance/flush-definition-cache.php'); $test = new TestSuite('HTML Purifier Multiple Versions Test'); $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 { echo "Invalid file passed\n"; exit; } } // This allows us to get out of having to do dry runs. $size = count($test_files); foreach ($versions_to_test as $version) { $flush = ''; if (is_array($version)) { $version = $version[0]; $flush = '--flush'; } if (!$AC['exclude-normal']) { $test->addTestCase( new CliTestCase( "$phpv $version index.php --xml $flush --disable-phpt $file", $AC['quiet'], $size ) ); } if (!$AC['exclude-standalone']) { $test->addTestCase( new CliTestCase( "$phpv $version index.php --xml $flush --standalone --disable-phpt $file", $AC['quiet'], $size ) ); } // naming is inconsistent: //if (!$AC['disable-phpt']) { $test->addTestCase( 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->addTestCase(new RemoteTestCase('http://localhost/htmlpurifier/tests/?xml=1', 'http://localhost/htmlpurifier/tests/?xml=1&dry=1')); $test->addTestCase(new RemoteTestCase('http://htmlpurifier.org/dev/tests/?xml=1', 'http://htmlpurifier.org/dev/tests/?xml=1&dry=1')); if ($AC['xml']) { $reporter = new XmlReporter(); } else { $reporter = new TextReporter(); } $test->run($reporter); shell_exec($AC['php'] . ' ../maintenance/flush-definition-cache.php');