@@ -48,30 +48,51 @@ public function testGetEnvWithPutEnv()
4848 $ this ->assertEquals ('true ' , Utility::getEnv (Utility::ENV_URL_PLUS_AS_SPACE ));
4949 }
5050
51- public function testUrlencodeWithDefault ()
51+ public function testUrlWithPlusAsDefault ()
5252 {
5353 $ url = Utility::urlencode ('bar baz ' );
5454 $ this ->assertEquals ('bar+baz ' , $ url );
5555 }
5656
57- public function testUrlencodeWithDollarServer ()
57+ public function testUrlWithPlusWithDollarServer ()
5858 {
5959 $ _SERVER [Utility::ENV_URL_PLUS_AS_SPACE ] = 'true ' ;
6060 $ url = Utility::urlencode ('bar baz ' );
61- $ this ->assertEquals ('bar%20baz ' , $ url );
61+ $ this ->assertEquals ('bar+baz ' , $ url );
6262 }
6363
64- public function testUrlencodeWithDollarEnv ()
64+ public function testUrlWithPlusWithDollarEnv ()
6565 {
6666 $ _ENV [Utility::ENV_URL_PLUS_AS_SPACE ] = 'true ' ;
6767 $ url = Utility::urlencode ('bar baz ' );
68- $ this ->assertEquals ('bar%20baz ' , $ url );
68+ $ this ->assertEquals ('bar+baz ' , $ url );
6969 }
7070
71- public function testUrlencodeWithPutEnv ()
71+ public function testUrlWithPlusWithPutEnv ()
7272 {
7373 putenv (Utility::ENV_URL_PLUS_AS_SPACE . '=true ' );
7474 $ url = Utility::urlencode ('bar baz ' );
75+ $ this ->assertEquals ('bar+baz ' , $ url );
76+ }
77+
78+ public function testUrlWith2BWithDollarServer ()
79+ {
80+ $ _SERVER [Utility::ENV_URL_PLUS_AS_SPACE ] = 'false ' ;
81+ $ url = Utility::urlencode ('bar baz ' );
82+ $ this ->assertEquals ('bar%20baz ' , $ url );
83+ }
84+
85+ public function testUrlWith2BWithDollarEnv ()
86+ {
87+ $ _ENV [Utility::ENV_URL_PLUS_AS_SPACE ] = 'false ' ;
88+ $ url = Utility::urlencode ('bar baz ' );
89+ $ this ->assertEquals ('bar%20baz ' , $ url );
90+ }
91+
92+ public function testUrlWith2BWithPutEnv ()
93+ {
94+ putenv (Utility::ENV_URL_PLUS_AS_SPACE . '=false ' );
95+ $ url = Utility::urlencode ('bar baz ' );
7596 $ this ->assertEquals ('bar%20baz ' , $ url );
7697 }
7798}
0 commit comments