/**
  * the singleton pattern
  *
  * @return Setup_TestServer
  */
 public static function getInstance()
 {
     if (self::$instance === NULL) {
         self::$instance = new Setup_TestServer();
     }
     return self::$instance;
 }
<?php

/**
 * Tine 2.0
 * 
 * @package     setup tests
 * @subpackage  test root
 * @license     http://www.gnu.org/licenses/agpl.html AGPL3
 * @copyright   Copyright (c) 2008-2016 Metaways Infosystems GmbH (http://www.metaways.de)
 * @author      Philipp Schüle <*****@*****.**>
 * 
 */
Tinebase_Session_Abstract::setSessionEnabled('TINE20SETUPSESSID');
Setup_TestServer::getInstance()->initFramework();
 /**
  * _installAllApps helper
  */
 protected function _installAllApps()
 {
     $installableApplications = Setup_Controller::getInstance()->getInstallableApplications();
     $installableApplications = array_keys($installableApplications);
     $testCredentials = Setup_TestServer::getInstance()->getTestCredentials();
     $this->_json->installApplications($installableApplications, array('adminLoginName' => $testCredentials['username'], 'adminPassword' => $testCredentials['password']));
 }
 /**
  * testInstallGroupNameOptions
  */
 public function testInstallGroupNameOptions()
 {
     $this->_uninstallAllApplications();
     $testCredentials = Setup_TestServer::getInstance()->getTestCredentials();
     $this->_installAllApplications(array('defaultAdminGroupName' => 'phpunit-admins', 'defaultUserGroupName' => 'phpunit-users', 'adminLoginName' => $testCredentials['username'], 'adminPassword' => $testCredentials['password']));
     $adminUser = Tinebase_Core::get('currentAccount');
     $this->assertEquals('phpunit-admins', Tinebase_User::getBackendConfiguration(Tinebase_User::DEFAULT_ADMIN_GROUP_NAME_KEY));
     $this->assertEquals('phpunit-users', Tinebase_User::getBackendConfiguration(Tinebase_User::DEFAULT_USER_GROUP_NAME_KEY));
     //cleanup
     $this->_uninstallAllApplications();
 }