diff --git a/test.php b/test.php new file mode 100644 index 0000000..5bf0e71 --- /dev/null +++ b/test.php @@ -0,0 +1,82 @@ + + +ICEcoder requirements tests + + + + +This file checks requirements needed by ICEcoder to run.

+If there are no test results with red items below, you should be able to run it fine. If not, consider the items in red.

+Test date, time & microtime:
".date("jS M Y g:i:sa")." (".microtime(true).")



"; + +$success = 0; + + +echo 'TEST 1 of 3
PHP Version:

ICEcoder needs at least PHP 5.0, tho 5.3 and above is recommended:

'; +echo "Your PHP Version: ".phpversion()."

"; + +echo 'TEST RESULT: '; +if (phpversion()*1 < 5.0) { + echo 'Your version of PHP doesn\'t seem to be high enough!'; +} else { + echo 'PHP version is OK'; + $success++; +} +echo "



"; + + + +if(!isset($_SESSION)) {@session_start();} +echo 'TEST 2 of 3
Sessions:

These values should all be the same:

'; +echo '
SESSION, BEFORE SET:
'.$_SESSION["string"]."
"; +if (!isset($_SESSION["string"])) { + $_SESSION["string"] = md5(uniqid(mt_rand(), true)); + header("Location: test.php?string=".$_SESSION["string"]); + echo ""; + die('Rerirect didn\'t happen...'); +} + +echo '
SESSION, AFTER SET:
'.$_SESSION["string"]."
"; +echo '
GET:
'.str_replace("<", "<", str_replace("<", "<", $_GET["string"]))."
"; +echo '
REQUEST:
'.str_replace("<", "<", str_replace("<", "<", $_REQUEST["string"]))."
"; +echo '
...and hitting this button shouldn\'t change the values:

'; +echo '
Reload page with GET param
'; +echo "

"; +echo 'TEST RESULT: '; +if ($_REQUEST["string"] !== $_SESSION["string"]) { + echo 'Values do not match!'; +} else { + echo 'Values match'; + $success++; +} + +echo "



"; + + + +echo 'TEST 3 of 3
Includes:

Attempt to include settings file:

'; + +$configSettings = 'config___settings.php'; +$configUsersTemplate = 'config___users-template.php'; + +// Load config settings +include(dirname(__FILE__)."/lib/".$configSettings); + +echo "This version of ICEcoder is: ".$ICEcoderSettings['versionNo']."

"; +echo 'TEST RESULT: '; +if (!isset($ICEcoderSettings['versionNo'])) { + echo 'Couldn\'t establish version, probably couldn\'t include settings file!'; +} else { + echo 'Version established'; + $success++; +} + +echo "



"; + +echo "Overall Test result:
"; +echo $success." of 3 tests passed successfully

"; +?> + + + \ No newline at end of file