Make WordPress Core


Ignore:
Timestamp:
09/06/2013 04:35:22 PM (13 years ago)
Author:
wonderboymusic
Message:

Check bad dates and redirect, instead of 404ing, as necessary and appropriate.
Adds query, conditional, and canonical Unit Tests.

Props kovshenin, SergeyBiryukov, DrewAPicture.
Fixes #10935.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/query/conditionals.php

    r25002 r25280  
    630630        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',
    631631        // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',
     632
     633        function test_bad_dates() {
     634                $this->go_to( '/2013/13/13/' );
     635                $this->assertQueryTrue( 'is_404' );
     636
     637                $this->go_to( '/2013/11/41/' );
     638                $this->assertQueryTrue( 'is_404' );
     639        }
    632640}
Note: See TracChangeset for help on using the changeset viewer.