Changeset 52010 for trunk/tests/phpunit/tests/formatting/redirect.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/redirect.php
r51568 r52010 7 7 */ 8 8 class Tests_Formatting_Redirect extends WP_UnitTestCase { 9 function set_up() {9 public function set_up() { 10 10 parent::set_up(); 11 11 add_filter( 'home_url', array( $this, 'home_url' ) ); 12 12 } 13 13 14 function home_url() {14 public function home_url() { 15 15 return 'http://example.com/'; 16 16 } … … 42 42 } 43 43 44 function test_wp_sanitize_redirect() {44 public function test_wp_sanitize_redirect() { 45 45 $this->assertSame( 'http://example.com/watchthelinefeedgo', wp_sanitize_redirect( 'http://example.com/watchthelinefeed%0Ago' ) ); 46 46 $this->assertSame( 'http://example.com/watchthelinefeedgo', wp_sanitize_redirect( 'http://example.com/watchthelinefeed%0ago' ) ); … … 61 61 * @ticket 36998 62 62 */ 63 function test_wp_sanitize_redirect_should_encode_spaces() {63 public function test_wp_sanitize_redirect_should_encode_spaces() { 64 64 $this->assertSame( 'http://example.com/test%20spaces', wp_sanitize_redirect( 'http://example.com/test%20spaces' ) ); 65 65 $this->assertSame( 'http://example.com/test%20spaces%20in%20url', wp_sanitize_redirect( 'http://example.com/test spaces in url' ) ); … … 69 69 * @dataProvider valid_url_provider 70 70 */ 71 function test_wp_validate_redirect_valid_url( $url, $expected ) {71 public function test_wp_validate_redirect_valid_url( $url, $expected ) { 72 72 $this->assertSame( $expected, wp_validate_redirect( $url ) ); 73 73 } … … 76 76 * @dataProvider invalid_url_provider 77 77 */ 78 function test_wp_validate_redirect_invalid_url( $url ) {78 public function test_wp_validate_redirect_invalid_url( $url ) { 79 79 $this->assertEquals( false, wp_validate_redirect( $url, false ) ); 80 80 } 81 81 82 function valid_url_provider() {82 public function valid_url_provider() { 83 83 return array( 84 84 array( 'http://example.com', 'http://example.com' ), … … 96 96 } 97 97 98 function invalid_url_provider() {98 public function invalid_url_provider() { 99 99 return array( 100 100 // parse_url() fails. … … 168 168 * @dataProvider relative_url_provider 169 169 */ 170 function test_wp_validate_redirect_relative_url( $current_uri, $url, $expected ) {170 public function test_wp_validate_redirect_relative_url( $current_uri, $url, $expected ) { 171 171 // Backup the global. 172 172 $unset = false; … … 199 199 * } 200 200 */ 201 function relative_url_provider() {201 public function relative_url_provider() { 202 202 return array( 203 203 array(
Note: See TracChangeset
for help on using the changeset viewer.