3 if (version_compare(PHP_VERSION, '5.3', '>='))
5 error_reporting(E_ALL ^ E_DEPRECATED ^ E_USER_DEPRECATED);
9 error_reporting(E_ALL);
12 if (version_compare(PHP_VERSION, '5.1', '>='))
14 $tz = timezone_identifiers_list();
15 date_default_timezone_set($tz[array_rand($tz)]);
18 header('Content-type: text/html; charset=UTF-8');
20 ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
23 <title>SimplePie: Unit Tests</title>
24 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
26 <style type="text/css">
33 font: 12px/18px Verdana, sans-serif;
35 background: #fff url(background.gif) repeat-x top left;
45 text-decoration: underline;
50 background-color: #333;
51 text-decoration: none;
56 margin: 30px 0 10px 0;
68 border-top: 1px solid #ccc;
71 h2 + p + p, h2 + p + p a {
80 border-top: 1px solid #ccc;
96 <script type="text/javascript">
97 // Sleight - Alpha transparency PNG's in Internet Explorer 5.5/6.0
98 // (c) 2001, Aaron Boodman; http://www.youngpup.net
100 if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
101 document.writeln('<style type="text/css">img, input.image { visibility:hidden; } </style>');
102 window.attachEvent("onload", fnLoadPngs);
105 function fnLoadPngs() {
106 var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
107 var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
109 for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--) {
110 if (itsAllGood && img.src.match(/\png$/i) != null) {
112 var div = document.createElement("DIV");
113 div.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizing='scale')";
114 div.style.width = img.width + "px";
115 div.style.height = img.height + "px";
116 img.replaceNode(div);
118 img.style.visibility = "visible";
128 <h1><img src="logo.png" alt="SimplePie Compatibility Test" title="SimplePie Compatibility Test"></h1>
129 <p><a href="#summary">Skip to the results</a> |
131 if (isset($_GET['remote'])) echo '<a href="?">Re-run without remote tests</a>';
132 else echo '<a href="?remote=true">Re-run with remote tests</a>';
137 require_once '../simplepie.inc';
138 require_once 'functions.php';
143 'feed_category_label',
154 'first_item_author_name',
155 'first_item_category_label',
156 'first_item_content',
157 'first_item_contributor_name',
159 'first_item_description',
161 'first_item_latitude',
162 'first_item_longitude',
163 'first_item_permalink',
167 $master = new Unit_Test2_Group('SimplePie Test Suite');
169 foreach ($tests as $test)
171 $test_group = new SimplePie_Unit_Test2_Group(ucwords(str_replace('_', ' ', $test)));
172 $test_group->load_folder($test);
173 $master->add($test_group);
176 $test_group = new SimplePie_Unit_Test2_Group('Who knows a <title> from a hole in the ground?');
177 $test_group->load_folder('who_knows_a_title_from_a_hole_in_the_ground');
178 $master->add($test_group);
180 $test_group = new SimplePie_Unit_Test2_Group('iTunesRSS');
181 $test_group->load_folder('itunes_rss');
182 $master->add($test_group);
184 if (isset($_GET['remote']))
186 $test_group = new SimplePie_Unit_Test2_Group('Atom autodiscovery test suite');
187 $test_group->add(new diveintomark_Atom_Autodiscovery);
188 $master->add($test_group);
193 $passed_percentage = floor($master->passes() / $master->total() * 100);
194 $failed_percentage = ceil($master->fails() / $master->total() * 100);
197 <h2 id="summary" class=<?php echo ($passed_percentage == 100) ? 'pass' : 'fail'; ?>><?php echo $passed_percentage; ?>% passed!</h2>
198 <?php echo '<p>We ran ' . $master->total() . ' tests in ' . round($master->time(), 3) . ' seconds (' . round($master->time() / $master->total(), 3) . ' seconds per test) of which ' . $master->passes() . ' (' . $passed_percentage . '%) passed, and ' . $master->fails() . ' (' . $failed_percentage . '%) failed.</p>'; ?>
200 <p><small>Powered by <a href="<?php echo SIMPLEPIE_URL; ?>"><?php echo SIMPLEPIE_NAME . ' ' . SIMPLEPIE_VERSION . ', Build ' . SIMPLEPIE_BUILD; ?></a>. SimplePie is © 2004–<?php echo date('Y'); ?>, Ryan Parman and Geoffrey Sneddon, and licensed under the <a href="http://www.opensource.org/licenses/bsd-license.php">BSD License</a>.</small></p>