@@ -30,63 +30,63 @@ public function testDropLinkedInParams(): void
3030
3131 $ test = 'foo=bar&code=foobar&baz=foo ' ;
3232 $ expected = '?foo=bar&baz=foo ' ;
33- $ this ->assertEquals ($ expected , $ gen ->dropLinkedInParams ($ test ));
33+ $ this ->assertSame ($ expected , $ gen ->dropLinkedInParams ($ test ));
3434
3535 $ test = 'code=foobar&baz=foo ' ;
3636 $ expected = '?baz=foo ' ;
37- $ this ->assertEquals ($ expected , $ gen ->dropLinkedInParams ($ test ));
37+ $ this ->assertSame ($ expected , $ gen ->dropLinkedInParams ($ test ));
3838
3939 $ test = 'foo=bar&code=foobar ' ;
4040 $ expected = '?foo=bar ' ;
41- $ this ->assertEquals ($ expected , $ gen ->dropLinkedInParams ($ test ));
41+ $ this ->assertSame ($ expected , $ gen ->dropLinkedInParams ($ test ));
4242
4343 $ test = 'code=foobar ' ;
4444 $ expected = '' ;
45- $ this ->assertEquals ($ expected , $ gen ->dropLinkedInParams ($ test ));
45+ $ this ->assertSame ($ expected , $ gen ->dropLinkedInParams ($ test ));
4646
4747 $ test = '' ;
4848 $ expected = '' ;
49- $ this ->assertEquals ($ expected , $ gen ->dropLinkedInParams ($ test ));
49+ $ this ->assertSame ($ expected , $ gen ->dropLinkedInParams ($ test ));
5050
5151 /* ----------------- */
5252
5353 $ test = 'foo=bar&code= ' ;
5454 $ expected = '?foo=bar ' ;
55- $ this ->assertEquals ($ expected , $ gen ->dropLinkedInParams ($ test ));
55+ $ this ->assertSame ($ expected , $ gen ->dropLinkedInParams ($ test ));
5656
5757 $ test = 'code= ' ;
5858 $ expected = '' ;
59- $ this ->assertEquals ($ expected , $ gen ->dropLinkedInParams ($ test ));
59+ $ this ->assertSame ($ expected , $ gen ->dropLinkedInParams ($ test ));
6060
6161 $ test = 'foo=bar&code ' ;
6262 $ expected = '?foo=bar ' ;
63- $ this ->assertEquals ($ expected , $ gen ->dropLinkedInParams ($ test ));
63+ $ this ->assertSame ($ expected , $ gen ->dropLinkedInParams ($ test ));
6464
6565 $ test = 'code ' ;
6666 $ expected = '' ;
67- $ this ->assertEquals ($ expected , $ gen ->dropLinkedInParams ($ test ));
67+ $ this ->assertSame ($ expected , $ gen ->dropLinkedInParams ($ test ));
6868 }
6969
7070 public function testGetUrl (): void
7171 {
7272 $ gen = new DummyUrlGenerator ;
7373
7474 $ expected = 'https://api.linkedin.com/?bar=baz ' ;
75- $ this ->assertEquals ($ expected , $ gen ->getUrl ('api ' , '' , ['bar ' => 'baz ' ]), 'No path ' );
75+ $ this ->assertSame ($ expected , $ gen ->getUrl ('api ' , '' , ['bar ' => 'baz ' ]), 'No path ' );
7676
7777 $ expected = 'https://api.linkedin.com/foobar ' ;
78- $ this ->assertEquals ($ expected , $ gen ->getUrl ('api ' , 'foobar ' ), 'Path does not begin with forward slash ' );
79- $ this ->assertEquals ($ expected , $ gen ->getUrl ('api ' , '/foobar ' ), 'Path begins with forward slash ' );
78+ $ this ->assertSame ($ expected , $ gen ->getUrl ('api ' , 'foobar ' ), 'Path does not begin with forward slash ' );
79+ $ this ->assertSame ($ expected , $ gen ->getUrl ('api ' , '/foobar ' ), 'Path begins with forward slash ' );
8080
8181 $ expected = 'https://api.linkedin.com/foobar?bar=baz ' ;
82- $ this ->assertEquals ($ expected , $ gen ->getUrl ('api ' , 'foobar ' , ['bar ' => 'baz ' ]), 'One parameter ' );
82+ $ this ->assertSame ($ expected , $ gen ->getUrl ('api ' , 'foobar ' , ['bar ' => 'baz ' ]), 'One parameter ' );
8383
8484 $ expected = 'https://api.linkedin.com/foobar?bar=baz&a=b&c=d ' ;
85- $ this ->assertEquals ($ expected , $ gen ->getUrl ('api ' , 'foobar ' , ['bar ' => 'baz ' , 'a ' => 'b ' , 'c ' => 'd ' ]), 'Many parameters ' );
85+ $ this ->assertSame ($ expected , $ gen ->getUrl ('api ' , 'foobar ' , ['bar ' => 'baz ' , 'a ' => 'b ' , 'c ' => 'd ' ]), 'Many parameters ' );
8686
8787 $ expected = 'https://api.linkedin.com/foobar?bar=baz%20a%20b ' ;
8888 $ notExpected = 'https://api.linkedin.com/foobar?bar=baz+a+b ' ;
89- $ this ->assertEquals ($ expected , $ gen ->getUrl ('api ' , 'foobar ' , ['bar ' => 'baz a b ' ]), 'Use of PHP_QUERY_RFC3986 ' );
89+ $ this ->assertSame ($ expected , $ gen ->getUrl ('api ' , 'foobar ' , ['bar ' => 'baz a b ' ]), 'Use of PHP_QUERY_RFC3986 ' );
9090 $ this ->assertNotEquals ($ notExpected , $ gen ->getUrl ('api ' , 'foobar ' , ['bar ' => 'baz a b ' ]), 'Dont use PHP_QUERY_RFC1738 ' );
9191 }
9292
@@ -95,10 +95,10 @@ public function testGetUrlWithParams(): void
9595 $ gen = new UrlGenerator ;
9696
9797 $ expected = 'https://api.linkedin.com/endpoint?bar=baz&format=json ' ;
98- $ this ->assertEquals ($ expected , $ gen ->getUrl ('api ' , 'endpoint?bar=baz ' , ['format ' => 'json ' ]));
98+ $ this ->assertSame ($ expected , $ gen ->getUrl ('api ' , 'endpoint?bar=baz ' , ['format ' => 'json ' ]));
9999
100100 $ expected = 'https://api.linkedin.com/endpoint?bar=baz&bar=baz ' ;
101- $ this ->assertEquals ($ expected , $ gen ->getUrl ('api ' , 'endpoint?bar=baz ' , ['bar ' => 'baz ' ]));
101+ $ this ->assertSame ($ expected , $ gen ->getUrl ('api ' , 'endpoint?bar=baz ' , ['bar ' => 'baz ' ]));
102102 }
103103
104104 public function testGetCurrentURL (): void
@@ -114,7 +114,7 @@ public function testGetCurrentURL(): void
114114
115115 // fake the HPHP $_SERVER globals
116116 $ _SERVER ['REQUEST_URI ' ] = '/unit-tests.php?one=one&two=two&three=three ' ;
117- $ this ->assertEquals (
117+ $ this ->assertSame (
118118 'http://www.test.com/unit-tests.php?one=one&two=two&three=three ' ,
119119 $ gen ->getCurrentUrl (),
120120 'getCurrentUrl function is changing the current URL ' ,
@@ -124,15 +124,15 @@ public function testGetCurrentURL(): void
124124 // an = sign was present, and sometimes it was not)
125125 // first test when equal signs are present
126126 $ _SERVER ['REQUEST_URI ' ] = '/unit-tests.php?one=&two=&three= ' ;
127- $ this ->assertEquals (
127+ $ this ->assertSame (
128128 'http://www.test.com/unit-tests.php?one=&two=&three= ' ,
129129 $ gen ->getCurrentUrl (),
130130 'getCurrentUrl function is changing the current URL ' ,
131131 );
132132
133133 // now confirm that
134134 $ _SERVER ['REQUEST_URI ' ] = '/unit-tests.php?one&two&three ' ;
135- $ this ->assertEquals (
135+ $ this ->assertSame (
136136 'http://www.test.com/unit-tests.php?one&two&three ' ,
137137 $ gen ->getCurrentUrl (),
138138 'getCurrentUrl function is changing the current URL ' ,
@@ -152,7 +152,7 @@ public function testGetCurrentURLPort80(): void
152152
153153 // test port 80
154154 $ _SERVER ['REQUEST_URI ' ] = '/foobar.php ' ;
155- $ this ->assertEquals (
155+ $ this ->assertSame (
156156 'http://www.test.com/foobar.php ' ,
157157 $ gen ->getCurrentUrl (),
158158 'port 80 should not be shown ' ,
@@ -172,7 +172,7 @@ public function testGetCurrentURLPort8080(): void
172172
173173 // test non default port 8080
174174 $ _SERVER ['REQUEST_URI ' ] = '/foobar.php ' ;
175- $ this ->assertEquals (
175+ $ this ->assertSame (
176176 'http://www.test.com:8080/foobar.php ' ,
177177 $ gen ->getCurrentUrl (),
178178 'port 80 should not be shown ' ,
@@ -185,21 +185,21 @@ public function testHttpHost(): void
185185 $ _SERVER ['HTTP_HOST ' ] = $ real ;
186186 $ _SERVER ['HTTP_X_FORWARDED_HOST ' ] = 'evil.com ' ;
187187 $ gen = new DummyUrlGenerator ;
188- $ this ->assertEquals ($ real , $ gen ->getHttpHost ());
188+ $ this ->assertSame ($ real , $ gen ->getHttpHost ());
189189 }
190190
191191 public function testHttpProtocolApache (): void
192192 {
193193 $ _SERVER ['HTTPS ' ] = 'on ' ;
194194 $ gen = new DummyUrlGenerator ;
195- $ this ->assertEquals ('https ' , $ gen ->getHttpProtocol ());
195+ $ this ->assertSame ('https ' , $ gen ->getHttpProtocol ());
196196 }
197197
198198 public function testHttpProtocolNginx (): void
199199 {
200200 $ _SERVER ['SERVER_PORT ' ] = '443 ' ;
201201 $ gen = new DummyUrlGenerator ;
202- $ this ->assertEquals ('https ' , $ gen ->getHttpProtocol ());
202+ $ this ->assertSame ('https ' , $ gen ->getHttpProtocol ());
203203 }
204204
205205 public function testHttpHostForwarded (): void
@@ -209,7 +209,7 @@ public function testHttpHostForwarded(): void
209209 $ _SERVER ['HTTP_X_FORWARDED_HOST ' ] = $ real ;
210210 $ gen = new DummyUrlGenerator ;
211211 $ gen ->setTrustForwarded (true );
212- $ this ->assertEquals ($ real , $ gen ->getHttpHost ());
212+ $ this ->assertSame ($ real , $ gen ->getHttpHost ());
213213 }
214214
215215 public function testHttpProtocolForwarded (): void
@@ -218,17 +218,17 @@ public function testHttpProtocolForwarded(): void
218218 $ _SERVER ['HTTP_X_FORWARDED_PROTO ' ] = 'http ' ;
219219 $ gen = new DummyUrlGenerator ;
220220 $ gen ->setTrustForwarded (true );
221- $ this ->assertEquals ('http ' , $ gen ->getHttpProtocol ());
221+ $ this ->assertSame ('http ' , $ gen ->getHttpProtocol ());
222222 }
223223
224224 public function testHttpProtocolForwardedSecure (): void
225225 {
226226 $ _SERVER ['HTTP_X_FORWARDED_PROTO ' ] = 'https ' ;
227227 $ gen = new DummyUrlGenerator ;
228- $ this ->assertEquals ('http ' , $ gen ->getHttpProtocol ());
228+ $ this ->assertSame ('http ' , $ gen ->getHttpProtocol ());
229229
230230 $ gen ->setTrustForwarded (true );
231- $ this ->assertEquals ('https ' , $ gen ->getHttpProtocol ());
231+ $ this ->assertSame ('https ' , $ gen ->getHttpProtocol ());
232232 }
233233}
234234
0 commit comments