[6286] | 1 | <?php |
---|
| 2 | header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); |
---|
| 3 | header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); |
---|
| 4 | header( 'Cache-Control: no-store, no-cache, must-revalidate' ); |
---|
| 5 | header( 'Cache-Control: post-check=0, pre-check=0', false ); |
---|
| 6 | header( 'Pragma: no-cache' ); |
---|
| 7 | ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
---|
| 8 | "http://www.w3.org/TR/html4/strict.dtd"> |
---|
| 9 | <html> |
---|
| 10 | <head> |
---|
| 11 | <meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
---|
| 12 | <title>DataTables unit test controller</title> |
---|
| 13 | |
---|
| 14 | <style type="text/css" media="screen"> |
---|
| 15 | #controller { |
---|
| 16 | font: 12px/1.45em "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; |
---|
| 17 | margin: 0; |
---|
| 18 | padding: 0 0 0 0.5em; |
---|
| 19 | color: #333; |
---|
| 20 | background-color: #fff; |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | #test_info { |
---|
| 24 | position: absolute; |
---|
| 25 | top: 0; |
---|
| 26 | right: 0; |
---|
| 27 | width: 50%; |
---|
| 28 | height: 100%; |
---|
| 29 | font-size: 11px; |
---|
| 30 | overflow: auto; |
---|
| 31 | } |
---|
| 32 | |
---|
| 33 | .error { |
---|
| 34 | color: red; |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | #controller h1 { |
---|
| 38 | color: #4E6CA3; |
---|
| 39 | font-size: 18px; |
---|
| 40 | } |
---|
| 41 | </style> |
---|
| 42 | |
---|
| 43 | <script type="text/javascript" language="javascript" src="../js/jquery.js"></script> |
---|
| 44 | <script type="text/javascript" charset="utf-8"> |
---|
| 45 | var gaoTest = [ |
---|
| 46 | <?php |
---|
| 47 | function fnReadDir( &$aReturn, $path ) |
---|
| 48 | { |
---|
| 49 | $rDir = opendir( $path ); |
---|
| 50 | while ( ($file = readdir($rDir)) !== false ) |
---|
| 51 | { |
---|
| 52 | if ( $file == "." || $file == ".." || $file == ".DS_Store" ) |
---|
| 53 | { |
---|
| 54 | continue; |
---|
| 55 | } |
---|
| 56 | else if ( is_dir( $path.'/'.$file ) ) |
---|
| 57 | { |
---|
| 58 | fnReadDir( $aReturn, $path.'/'.$file ); |
---|
| 59 | } |
---|
| 60 | else |
---|
| 61 | { |
---|
| 62 | array_push( $aReturn, $path.'/'.$file ); |
---|
| 63 | } |
---|
| 64 | } |
---|
| 65 | closedir($rDir); |
---|
| 66 | } |
---|
| 67 | |
---|
| 68 | /* Get the tests dynamically from the 'tests' directory, and their templates */ |
---|
| 69 | $aFiles = array(); |
---|
| 70 | fnReadDir( $aFiles, "tests" ); |
---|
| 71 | |
---|
| 72 | for ( $i=0 ; $i<count($aFiles) ; $i++ ) |
---|
| 73 | { |
---|
| 74 | $sTemplate; |
---|
| 75 | $fp = fopen( $aFiles[$i], "r" ); |
---|
| 76 | fscanf( $fp, "// DATA_TEMPLATE: %s", $sTemplate ); |
---|
| 77 | fclose( $fp ); |
---|
| 78 | |
---|
| 79 | $aPath = explode('/', $aFiles[$i]); |
---|
| 80 | |
---|
| 81 | echo '{ '. |
---|
| 82 | '"sTemplate": "'.$sTemplate.'", '. |
---|
| 83 | '"sTest": "'.$aFiles[$i].'", '. |
---|
| 84 | '"sGroup": "'.$aPath[1].'"},'."\n"; |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | ?> |
---|
| 88 | null ]; |
---|
| 89 | gaoTest.pop(); /* No interest in the null */ |
---|
| 90 | </script> |
---|
| 91 | <script type="text/javascript" language="javascript" src="controller.js"></script> |
---|
| 92 | </head> |
---|
| 93 | <body id="controller"> |
---|
| 94 | <h1>DataTables unit testing</h1> |
---|
| 95 | <div id="test_running">Running test: <span id="test_number"></span></div> |
---|
| 96 | <div id="test_info"> |
---|
| 97 | <b>Test information:</b><br> |
---|
| 98 | </div> |
---|
| 99 | </body> |
---|
| 100 | </html> |
---|