45 public static function setUpBeforeClass()
47 parent::setUpBeforeClass();
48 SecurityTestHelper::createSuperAdmin();
51 public function setup()
56 public function testSuperUserAllDefaultControllerActions()
62 public function testRunDiagnostic()
64 ZurmoRedBean::exec(
"SHOW TABLES");
65 $countBefore = ZurmoRedBean::getCell(
"SELECT FOUND_ROWS();");
67 $this->assertContains(
"Failed Required Services", $content);
68 $this->assertContains(
"<span class=\"fail\">FAIL</span>", $content);
69 $this->assertContains(
"Zurmo runs only on Apache 2.2.1 and higher or Microsoft-IIS 5.0.0 or higher web servers.", $content);
70 $this->assertContains(
"\$_SERVER does not have HTTP_HOST, SERVER_NAME, SERVER_PORT, HTTP_ACCEPT, HTTP_USER_AGENT", $content);
71 $criticalFailureCount = substr_count($content,
"<span class=\"fail\">FAIL</span>");
72 $this->assertThat(
true, $this->logicalOr($this->equalTo(2, $criticalFailureCount), $this->equalTo(3, $criticalFailureCount)));
73 if ($criticalFailureCount === 3)
77 strpos($content,
"The application.log runtime file is writable.<br />\n" .
78 "The /minScript/cache runtime directory is not writable.<br />\n" .
79 "The debug.php file is present.") !==
false ||
81 strpos($content,
"Host Info/Script Url is incorrectly configured.") !==
false
84 $this->assertFileExists(realpath(INSTANCE_ROOT . DIRECTORY_SEPARATOR .
'protected' . DIRECTORY_SEPARATOR .
'config' . DIRECTORY_SEPARATOR .
'perInstance.php'));
85 $this->assertFileExists(realpath(INSTANCE_ROOT . DIRECTORY_SEPARATOR .
'protected' . DIRECTORY_SEPARATOR .
'config' . DIRECTORY_SEPARATOR .
'debug.php'));
86 ZurmoRedBean::exec(
"SHOW TABLES");
87 $countAfter = ZurmoRedBean::getCell(
"SELECT FOUND_ROWS();");
88 $this->assertEquals($countBefore, $countAfter);
logoutCurrentUserLoginNewUserAndGetByUsername($username)
runControllerWithNoExceptionsAndGetContent($route, $empty=false)