File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,21 @@ public function testHostEnvironmentDetection()
122
122
$ _SERVER ['HTTP_HOST ' ] = $ backup ;
123
123
}
124
124
125
+ public function testServerNameEnvironmentDetection ()
126
+ {
127
+ Environments::tearDown ();
128
+ EnvironmentsTestWrapper::prepareTestEnvironments ();
129
+
130
+ $ hostBackup = isset ($ _SERVER ['HTTP_HOST ' ]) ? $ _SERVER ['HTTP_HOST ' ] : 'localhost ' ;
131
+ $ serverNameBackup = isset ($ _SERVER ['SERVER_NAME ' ]) ? $ _SERVER ['SERVER_NAME ' ] : 'localhost ' ;
132
+ $ _SERVER ['HTTP_HOST ' ] = null ;
133
+ $ _SERVER ['SERVER_NAME ' ] = 'test.com ' ;
134
+ $ this ->assertEquals ('testing ' , EnvironmentsTestWrapper::getEnvironment ());
135
+
136
+ $ _SERVER ['HTTP_HOST ' ] = $ hostBackup ;
137
+ $ _SERVER ['SERVER_NAME ' ] = $ serverNameBackup ;
138
+ }
139
+
125
140
public function testPathEnvironmentDetection ()
126
141
{
127
142
Environments::tearDown ();
You can’t perform that action at this time.
0 commit comments