public function setUp() { if (!function_exists('ldap_bind')) { throw new \Exception("PHP not compiled w/ --with-ldap!"); } if (!$this->isLdapServerRunning()) { throw new \Exception("LDAP server not found on port localhost:389. For integration tests, an LDAP server must be running with the " . "data and configuration found in tests/travis/setup_ldap.sh script. An OpenLDAP server is expected, but any " . "will work assuming the attributes names & data are the same."); } parent::setUp(); Config::getInstance()->LoginLdap = Config::getInstance()->LoginLdapTest + array('servers' => 'testserver', 'use_webserver_auth' => 'false', 'new_user_default_sites_view_access' => '1,2', 'synchronize_users_after_login' => 1); Config::getInstance()->LoginLdap_testserver = Config::getInstance()->LoginLdap_testserver + array('hostname' => self::SERVER_HOST_NAME, 'port' => self::SERVER_PORT, 'base_dn' => self::SERVER_BASE_DN, 'admin_user' => 'cn=fury,' . self::SERVER_BASE_DN, 'admin_pass' => 'secrets'); LdapFunctions::$phpUnitMock = null; // create sites referenced in setup_ldap.sh Fixture::createWebsite('2013-01-01 00:00:00'); Fixture::createWebsite('2013-01-01 00:00:00'); Fixture::createWebsite('2013-01-01 00:00:00'); }
public function tearDown() { restore_error_handler(); LdapFunctions::$phpUnitMock = null; parent::tearDown(); }
public function tearDown() { restore_error_handler(); LdapFunctions::$phpUnitMock = null; Log::unsetInstance(); }