Changeset 46649 for trunk/tests/phpunit/tests/formatting/redirect.php
- Timestamp:
- 11/04/2019 12:57:17 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/redirect.php
r46586 r46649 19 19 function home_url() { 20 20 return 'http://example.com/'; 21 } 22 23 /** 24 * @ticket 44317 25 * 26 * @dataProvider get_bad_status_codes 27 * @expectedException WPDieException 28 * 29 * @param string $location The path or URL to redirect to. 30 * @param int $status HTTP response status code to use. 31 */ 32 public function test_wp_redirect_bad_status_code( $location, $status ) { 33 wp_redirect( $location, $status ); 34 } 35 36 public function get_bad_status_codes() { 37 return array( 38 // Tests for bad arguments 39 array( '/wp-admin', 404 ), 40 array( '/wp-admin', 410 ), 41 array( '/wp-admin', 500 ), 42 // Tests for condition. 43 array( '/wp-admin', 299 ), 44 array( '/wp-admin', 400 ), 45 ); 21 46 } 22 47
Note: See TracChangeset
for help on using the changeset viewer.