protected function checkService() { $passed = true; $databaseDefaultCollation = null; if (!InstallUtil::checkDatabaseDefaultCollation('mysql', $this->form->databaseHostname, $this->form->databaseName, $this->form->databaseUsername, $this->form->databasePassword, $this->form->databasePort, $this->notAllowedDatabaseCollations, $databaseDefaultCollation)) { if ($databaseDefaultCollation != null) { $notAllowedCollations = implode(', ', $this->notAllowedDatabaseCollations); $this->message = Zurmo::t('InstallModule', 'Database default collation is: {collation}', array('{collation}' => $databaseDefaultCollation)); $this->message .= ' . '; $this->message .= Zurmo::t('InstallModule', 'Database default collation should not be in: {listOfCollations}', array('{listOfCollations}' => $notAllowedCollations)); } else { $this->message = Zurmo::t('InstallModule', 'Could not get value of database default collation.'); } $passed = false; } else { $this->message = Zurmo::t('InstallModule', 'Database default collation meets minimum requirement.'); } return $passed; }
/** * Simple test to confirm the check doesnt break. */ public function testCheckDatabaseDefaultCollation() { $notAllowedDatabaseCollations = array('utf8_general_ci'); $databaseDefaultCollation = null; $this->assertNotNull(InstallUtil::checkDatabaseDefaultCollation('mysql', $this->temporaryDatabaseHostname, $this->temporaryDatabaseName, $this->temporaryDatabaseUsername, $this->temporaryDatabasePassword, $this->temporaryDatabasePort, $notAllowedDatabaseCollations, $databaseDefaultCollation)); }