public function test_get_environment() { $ogServer = $_SERVER; $_SERVER['SERVER_NAME'] = 'localhost.jor.pw'; $this->assertEquals(Environment::ENV_LOCAL, Environment::get_environment(), "localhost.jor.pw should be marked as local env"); $_SERVER['SERVER_NAME'] = 'test.jor.pw'; $this->assertEquals(Environment::ENV_TEST, Environment::get_environment(), "test.jor.pw should be marked as test env"); $_SERVER['SERVER_NAME'] = 'staging.jor.pw'; $this->assertEquals(Environment::ENV_STAGING, Environment::get_environment(), "staging.jor.pw should be marked as staging env"); $_SERVER['SERVER_NAME'] = 'jor.pw'; $this->assertEquals(Environment::ENV_PROD, Environment::get_environment(), "jor.pw should be marked as production env"); $_SERVER = $ogServer; }