Make WordPress Core

Changeset 31846


Ignore:
Timestamp:
03/20/2015 12:25:27 PM (11 years ago)
Author:
boonebgorges
Message:

Enforce non-pretty permalinks in RSS2 tests.

Previously, the tests were using '/feed/' in their go_to() statements, but
testing nodes for URLs like '?p='. This mismatch created unpredictable results
when the run in certain sequences with other groups of unit tests.

See #31705.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/feed/rss2.php

    r31845 r31846  
    1010 */
    1111class Tests_Feed_RSS2 extends WP_UnitTestCase {
     12        private $permalink_structure = '';
    1213
    13         function setUp() {
     14        public function setUp() {
     15                global $wp_rewrite;
     16                $this->permalink_structure = get_option( 'permalink_structure' );
     17                $wp_rewrite->set_permalink_structure( '' );
     18                $wp_rewrite->flush_rules();
     19
    1420                parent::setUp();
    1521
     
    2329                // this seems to break something
    2430                update_option('use_smilies', false);
     31        }
     32
     33        public function tearDown() {
     34                global $wp_rewrite;
     35                $wp_rewrite->set_permalink_structure( $this->permalink_structure );
     36                $wp_rewrite->flush_rules();
    2537        }
    2638
     
    4052
    4153        function test_rss() {
    42                 $this->go_to('/feed/');
     54                $this->go_to( '/?feed=rss2' );
    4355                $feed = $this->do_rss2();
    4456                $xml = xml_to_array($feed);
     
    6072
    6173        function test_channel() {
    62                 $this->go_to('/feed/');
     74                $this->go_to( '/?feed=rss2' );
    6375                $feed = $this->do_rss2();
    6476                $xml = xml_to_array($feed);
     
    8698         */
    8799        function test_items() {
    88                 $this->go_to('/feed/');
     100                $this->go_to( '/?feed=rss2' );
    89101                $feed = $this->do_rss2();
    90102                $xml = xml_to_array($feed);
Note: See TracChangeset for help on using the changeset viewer.