WordPress.org

Make WordPress Core

Changeset 275 in tests


Ignore:
Timestamp:
12/07/2009 06:18:56 PM (8 years ago)
Author:
westi
Message:

Add test cases for like_escape. relates WP#10041.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_formatting.php

    r273 r275  
    461461}
    462462
     463class TestLikeEscape extends WPTestCase {
     464    function test_like_escape() {
     465        $this->knownWPBug(10041);
     466
     467        $inputs = array(
     468            'howdy%', //Single Percent
     469            'howdy_', //Single Underscore
     470            'howdy\\', //Single slash
     471            'howdy\\howdy%howdy_', //The works
     472        );
     473        $expected = array(
     474            "howdy\\%",
     475            'howdy\\_',
     476            'howdy\\\\',
     477            'howdy\\\\howdy\\%howdy\\_'
     478        );
     479       
     480        foreach ($inputs as $key => $input) {
     481            $this->assertEquals($expected[$key], like_escape($input));
     482        }
     483    }
     484
     485}
     486
    463487?>
Note: See TracChangeset for help on using the changeset viewer.