WordPress.org

Make WordPress Core

Changeset 628 in tests


Ignore:
Timestamp:
04/07/2012 01:18:52 AM (6 years ago)
Author:
markjaquith
Message:

Add some tests to test stripping of post_type argument in canonical redirects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_canonical.php

    r626 r628  
    261261         *      (string) expected redirect location
    262262         * [3]: (optional) The ticket the test refers to, Can be skipped if unknown.
    263          */
     263         */     
    264264        return array(
    265265            array( '/?p=123', '/?p=123' ),
    266266
     267            // This post_type arg should be stripped, because p=1 exists, and does not have post_type= in its query string
     268            array( '/?post_type=fake-cpt&p=1', '/?p=1' ),
     269
     270            // Strip an existing but incorrect post_type arg
     271            array( '/?post_type=page&page_id=1', '/?p=1' ),
     272
    267273            array( '/?p=358 ', array('url' => '/?p=358',  'qv' => array('p' => '358') ) ), // Trailing spaces
    268274            array( '/?p=358%20', array('url' => '/?p=358',  'qv' => array('p' => '358') ) ),
Note: See TracChangeset for help on using the changeset viewer.