aboutsummaryrefslogtreecommitdiffstats
path: root/test/polluted.php
diff options
context:
space:
mode:
authorAriel Flesler <aflesler@gmail.com>2008-05-28 20:19:18 +0000
committerAriel Flesler <aflesler@gmail.com>2008-05-28 20:19:18 +0000
commit52fbe5d2a8441c9bca5c2b8b9fa8b2bc388a11c1 (patch)
tree2f000ae079f3f722149059f72a81c7e6b00f5dcd /test/polluted.php
parent6bf51eea0489149c755f12007b585dc5521b46d3 (diff)
downloadjquery-52fbe5d2a8441c9bca5c2b8b9fa8b2bc388a11c1.tar.gz
jquery-52fbe5d2a8441c9bca5c2b8b9fa8b2bc388a11c1.zip
test runner: adding a new test page called 'polluted'. Where one can choose to pre-include other libraries and run the test suite with them.
Diffstat (limited to 'test/polluted.php')
-rw-r--r--test/polluted.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/polluted.php b/test/polluted.php
new file mode 100644
index 000000000..94f63d7f6
--- /dev/null
+++ b/test/polluted.php
@@ -0,0 +1,51 @@
+<?php
+ if( count($_POST) ){ // second call
+ $includes = array();
+ foreach( $_POST as $lib=>$ver ){
+ if( !$ver )
+ continue;
+ $include = "<script type='text/javascript' src='otherlibs/$lib/$ver/$lib.js'></script>\n";
+ if( $lib == 'prototype' ) // prototype must be included first
+ array_unshift( $includes, $include );
+ else
+ array_push( $includes, $include );
+ }
+
+ $includes = implode( "\n", $includes );
+ $suite = file_get_contents('index.html');
+ echo str_replace( '<!-- Includes -->', $includes, $suite );
+ exit;
+ }
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" id="html">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>jQuery Test Suite</title>
+ <link rel="Stylesheet" media="screen" href="data/testsuite.css" />
+</head>
+
+<body id="body">
+ <h1 id="header">jQuery Test Suite</h1>
+ <h2 id="banner" class="fail"></h2>
+ <h2 id="userAgent">Choose other libraries to include</h2>
+
+ <form class="otherlibs" action="" method="post">
+ <?php
+ $libs = scandir('otherlibs');
+ foreach( $libs as $lib ){
+ if( $lib[0] == '.' )
+ continue;
+ echo "<h3>$lib</h3>";
+ $vers = scandir( "otherlibs/$lib");
+ foreach( $vers as $ver ){
+ if( $ver[0] != '.' )
+ echo "<label><input type='checkbox' name='$lib' value='$ver'>$ver</label>";
+ }
+ }
+ ?>
+ <input type="submit" value="Run" class="submit" />
+ </form>
+</body>
+</html>