Make WordPress Core

Changeset 228 in tests


Ignore:
Timestamp:
06/20/2009 05:18:10 PM (15 years ago)
Author:
westi
Message:

Add some test cases for wp_sanitize_redirect()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_pluggable.php

    r221 r228  
    9898}
    9999
     100class TestRedirectFunctions extends WPTestCase {
     101    function test_wp_sanitize_redirect() {
     102        $this->assertEquals('http://example.com/watchthelinefeedgo', wp_sanitize_redirect('http://example.com/watchthelinefeed%0Ago'));
     103        $this->assertEquals('http://example.com/watchthelinefeedgo', wp_sanitize_redirect('http://example.com/watchthelinefeed%0ago'));
     104        $this->assertEquals('http://example.com/watchthecarriagereturngo', wp_sanitize_redirect('http://example.com/watchthecarriagereturn%0Dgo'));
     105        $this->assertEquals('http://example.com/watchthecarriagereturngo', wp_sanitize_redirect('http://example.com/watchthecarriagereturn%0dgo'));
     106        //Nesting checks
     107        $this->assertEquals('http://example.com/watchthecarriagereturngo', wp_sanitize_redirect('http://example.com/watchthecarriagereturn%0%0ddgo'));
     108        $this->assertEquals('http://example.com/watchthecarriagereturngo', wp_sanitize_redirect('http://example.com/watchthecarriagereturn%0%0DDgo'));
     109    }
     110   
     111}
    100112?>
Note: See TracChangeset for help on using the changeset viewer.