path/vendors/simpletest"; $test_path = "$CONFIG->path/engine/tests"; require_once("$vendor_path/unit_tester.php"); require_once("$vendor_path/mock_objects.php"); require_once("$vendor_path/reporter.php"); require_once("$test_path/elgg_unit_test.php"); $suite = new TestSuite('Elgg Core Unit Tests'); // emit a hook to pull in all tests $test_files = trigger_plugin_hook('unit_test', 'system', null, array()); foreach ($test_files as $file) { $suite->addTestFile($file); } // Only run tests in debug mode. if ($CONFIG->debug > 0) { if (TextReporter::inCli()) { // In CLI error codes are returned. // 0 is success. elgg_set_ignore_access(TRUE); exit ($suite->Run(new TextReporter()) ? 0 : 1 ); } // Ensure that only logged-in users can see this page admin_gatekeeper(); $old = elgg_set_ignore_access(TRUE); $suite->Run(new HtmlReporter()); elgg_set_ignore_access($old); } else { // @todo display an error? exit (1); }