diff --git tests/phpunit/tests/functions.php tests/phpunit/tests/functions.php
index 6d6e177..6aca8f7 100644
|
|
class Tests_Functions extends WP_UnitTestCase { |
281 | 281 | admin_url( 'edit.php?baz&za=1' ), |
282 | 282 | admin_url( 'edit.php?baz=1&za=1' ), |
283 | 283 | admin_url( 'edit.php?baz=0&za=0' ), |
| 284 | '/?baz=1&qux=2', |
| 285 | '/?baz=1&qux=2', |
| 286 | '/?baz=1&qux=2', |
284 | 287 | ); |
285 | 288 | |
286 | 289 | foreach ( $qs_urls as $url ) { |
… |
… |
class Tests_Functions extends WP_UnitTestCase { |
291 | 294 | $this->assertEquals( "$url&foo=2", add_query_arg( array( 'foo' => '1', 'foo' => '2' ), $url ) ); |
292 | 295 | $this->assertEquals( "$url&foo=1&bar=2", add_query_arg( array( 'foo' => '1', 'bar' => '2' ), $url ) ); |
293 | 296 | |
| 297 | $url_with_frag = $url . '#frag'; |
| 298 | |
| 299 | $this->assertEquals( "$url&foo=1#frag", add_query_arg( 'foo', '1', $url_with_frag ) ); |
| 300 | $this->assertEquals( "$url&foo=1#frag", add_query_arg( array( 'foo' => '1' ), $url_with_frag ) ); |
| 301 | $this->assertEquals( "$url&foo=2#frag", add_query_arg( array( 'foo' => '1', 'foo' => '2' ), $url_with_frag ) ); |
| 302 | $this->assertEquals( "$url&foo=1&bar=2#frag", add_query_arg( array( 'foo' => '1', 'bar' => '2' ), $url_with_frag ) ); |
| 303 | |
294 | 304 | $_SERVER['REQUEST_URI'] = $url; |
295 | 305 | |
296 | 306 | $this->assertEquals( "$url&foo=1", add_query_arg( 'foo', '1' ) ); |
297 | 307 | $this->assertEquals( "$url&foo=1", add_query_arg( array( 'foo' => '1' ) ) ); |
298 | 308 | $this->assertEquals( "$url&foo=2", add_query_arg( array( 'foo' => '1', 'foo' => '2' ) ) ); |
299 | 309 | $this->assertEquals( "$url&foo=1&bar=2", add_query_arg( array( 'foo' => '1', 'bar' => '2' ) ) ); |
| 310 | |
| 311 | $_SERVER['REQUEST_URI'] = $url_with_frag; |
| 312 | |
| 313 | $this->assertEquals( "$url&foo=1#frag", add_query_arg( 'foo', '1' ) ); |
| 314 | $this->assertEquals( "$url&foo=1#frag", add_query_arg( array( 'foo' => '1' ) ) ); |
| 315 | $this->assertEquals( "$url&foo=2#frag", add_query_arg( array( 'foo' => '1', 'foo' => '2' ) ) ); |
| 316 | $this->assertEquals( "$url&foo=1&bar=2#frag", add_query_arg( array( 'foo' => '1', 'bar' => '2' ) ) ); |
300 | 317 | } |
301 | 318 | |
302 | 319 | $_SERVER['REQUEST_URI'] = $old_req_uri; |
… |
… |
class Tests_Functions extends WP_UnitTestCase { |
461 | 478 | 'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25', |
462 | 479 | true, |
463 | 480 | ), |
464 | | // Android 2.2, Android Webkit Browser |
| 481 | // Android 2.2, Android Webkit Browser |
465 | 482 | array( |
466 | 483 | 'Mozilla/5.0 (Android 2.2; Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4', |
467 | 484 | true, |
468 | 485 | ), |
469 | | // BlackBerry 9900, BlackBerry browser |
| 486 | // BlackBerry 9900, BlackBerry browser |
470 | 487 | array( |
471 | 488 | 'Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.346 Mobile Safari/534.11+', |
472 | 489 | true, |