]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Test suite now requires admin for web-based tests.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 13 Oct 2009 21:54:05 +0000 (21:54 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 13 Oct 2009 21:54:05 +0000 (21:54 +0000)
Uses access overrides for cli-based tests.

git-svn-id: http://code.elgg.org/elgg/trunk@3531 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/tests/suite.php

index 7299585272bcb381d7babaeb5a32ccafc281bcd7..dbe88065ae25190521f780504c3f9446fa20cc03 100755 (executable)
@@ -11,9 +11,6 @@
 
 require_once(dirname( __FILE__ ) . '/../start.php');
 
-// Ensure that only logged-in users can see this page
-gatekeeper();
-
 $vendor_path = "$CONFIG->path/vendors/simpletest";
 $test_path = "$CONFIG->path/engine/tests";
 
@@ -35,9 +32,14 @@ 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);