diff --git a/security/BasicAuth.php b/security/BasicAuth.php index e1e314d22..7c13606b2 100755 --- a/security/BasicAuth.php +++ b/security/BasicAuth.php @@ -44,7 +44,7 @@ class BasicAuth { * @return Member $member */ static function requireLogin($realm, $permissionCode = null, $tryUsingSessionLogin = true) { - if(!Security::database_is_ready()) return true; + if(!Security::database_is_ready() || (Director::is_cli() && !SapphireTest::is_running_test())) return true; $member = null; if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { diff --git a/tests/WebserverRoutingTest.php b/tests/WebserverRoutingTest.php index b7fa9c9d0..fc82efc37 100644 --- a/tests/WebserverRoutingTest.php +++ b/tests/WebserverRoutingTest.php @@ -26,7 +26,7 @@ class WebserverRoutingTest extends SapphireTest { $info = curl_getinfo($ch); $this->assertEquals(curl_error($ch), ''); - $this->assertEquals(trim($response), 'ok'); + $this->assertTrue(in_array(trim($response), array('ok', _t('BasicAuth.ENTERINFO')))); curl_close($ch); }