Make WordPress Core

Changeset 32147


Ignore:
Timestamp:
04/19/2015 05:38:07 AM (11 years ago)
Author:
pento
Message:

Backport the PHPUnit test fixes from [31622] to the 4.1 branch.

Props boonebgorges.

See #31537.

Location:
branches/4.1/tests/phpunit/tests
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • branches/4.1/tests/phpunit/tests/admin/includesScreen.php

    r26456 r32147  
    3838
    3939        function tearDown() {
    40                 parent::tearDown();
    4140                unset( $GLOBALS['wp_taxonomies']['old-or-new'] );
    4241                set_current_screen( 'front' );
     42                parent::tearDown();
    4343        }
    4444
  • branches/4.1/tests/phpunit/tests/ajax/Autosave.php

    r26995 r32147  
    4747         */
    4848        public function tearDown() {
     49                wp_set_current_user( 0 );
    4950                parent::tearDown();
    50                 wp_set_current_user( 0 );
    5151        }
    5252
  • branches/4.1/tests/phpunit/tests/ajax/Response.php

    r25002 r32147  
    3737         */
    3838        public function tearDown() {
    39                 parent::tearDown();
    4039                remove_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 );
    4140                error_reporting( $this->_error_level );
     41                parent::tearDown();
    4242        }
    4343
  • branches/4.1/tests/phpunit/tests/basic.php

    r28631 r32147  
    1414
    1515        function tearDown() {
     16                $this->val = false;
    1617                parent::tearDown();
    17                 $this->val = false;
    1818        }
    1919
  • branches/4.1/tests/phpunit/tests/cache.php

    r25002 r32147  
    1515
    1616        function tearDown() {
     17                $this->flush_cache();
    1718                parent::tearDown();
    18                 $this->flush_cache();
    1919        }
    2020
  • branches/4.1/tests/phpunit/tests/canonical.php

    r30282 r32147  
    2424
    2525        public function tearDown() {
     26                wp_set_current_user( self::$old_current_user );
    2627                parent::tearDown();
    27                 wp_set_current_user( self::$old_current_user );
    2828        }
    2929
  • branches/4.1/tests/phpunit/tests/canonical/pageOnFront.php

    r30277 r32147  
    2727        function tearDown() {
    2828                global $wp_rewrite;
     29                $wp_rewrite->init();
    2930                parent::tearDown();
    30                 $wp_rewrite->init();
    3131        }
    3232
  • branches/4.1/tests/phpunit/tests/category.php

    r28706 r32147  
    1111
    1212        function tearDown() {
     13                _unregister_taxonomy( 'test_tax_cat' );
    1314                parent::tearDown();
    14 
    15                 _unregister_taxonomy( 'test_tax_cat' );
    1615        }
    1716
  • branches/4.1/tests/phpunit/tests/comment/getCommentsPagesCount.php

    r27055 r32147  
    2727         */
    2828        function tearDown() {
    29                 parent::tearDown();
    3029                update_option( 'page_comments', $this->option_page_comments );
    3130                update_option( 'comments_per_page', $this->option_page_comments );
    3231                update_option( 'thread_comments', $this->option_page_comments );
    3332                update_option( 'posts_per_rss', $this->option_posts_per_rss );
     33                parent::tearDown();
    3434        }
    3535
  • branches/4.1/tests/phpunit/tests/cron.php

    r29939 r32147  
    1414
    1515        function tearDown() {
    16                 parent::tearDown();
    1716                // make sure the schedule is clear
    1817                _set_cron_array(array());
     18                parent::tearDown();
    1919        }
    2020
  • branches/4.1/tests/phpunit/tests/customize/manager.php

    r31329 r32147  
    1717
    1818        function tearDown() {
    19                 parent::tearDown();
    2019                $this->manager = null;
    2120                unset( $GLOBALS['wp_customize'] );
     21                parent::tearDown();
    2222        }
    2323
  • branches/4.1/tests/phpunit/tests/customize/setting.php

    r31410 r32147  
    2727
    2828        function tearDown() {
    29                 parent::tearDown();
    3029                $this->manager = null;
    3130                unset( $GLOBALS['wp_customize'] );
     31                parent::tearDown();
    3232        }
    3333
  • branches/4.1/tests/phpunit/tests/image/base.php

    r30549 r32147  
    2323         */
    2424        public function tearDown() {
     25                remove_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 );
    2526                parent::tearDown();
    26 
    27                 remove_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 );
    2827        }
    2928
  • branches/4.1/tests/phpunit/tests/link.php

    r30401 r32147  
    77        function tearDown() {
    88                global $wp_rewrite;
     9                $wp_rewrite->init();
    910                parent::tearDown();
    10                 $wp_rewrite->init();
    1111        }
    1212
  • branches/4.1/tests/phpunit/tests/mail.php

    r30516 r32147  
    1212
    1313        function tearDown() {
     14                unset( $_SERVER['SERVER_NAME'] );
    1415                parent::tearDown();
    15                 unset( $_SERVER['SERVER_NAME'] );
    1616        }
    1717
  • branches/4.1/tests/phpunit/tests/multisite/bootstrap.php

    r29916 r32147  
    2222        function tearDown() {
    2323                global $wpdb;
     24                $wpdb->suppress_errors( $this->suppress );
    2425                parent::tearDown();
    25                 $wpdb->suppress_errors( $this->suppress );
    2626        }
    2727
  • branches/4.1/tests/phpunit/tests/multisite/ms-files-rewriting.php

    r30404 r32147  
    3030
    3131                update_site_option( 'ms_files_rewriting', 0 );
     32                $wpdb->suppress_errors( $this->suppress );
     33
    3234                parent::tearDown();
    33                 $wpdb->suppress_errors( $this->suppress );
    3435        }
    3536
  • branches/4.1/tests/phpunit/tests/multisite/network.php

    r30559 r32147  
    2323        function tearDown() {
    2424                global $wpdb;
     25                $wpdb->suppress_errors( $this->suppress );
    2526                parent::tearDown();
    26                 $wpdb->suppress_errors( $this->suppress );
    2727        }
    2828
  • branches/4.1/tests/phpunit/tests/multisite/site.php

    r30786 r32147  
    2222        function tearDown() {
    2323                global $wpdb;
     24                $wpdb->suppress_errors( $this->suppress );
    2425                parent::tearDown();
    25                 $wpdb->suppress_errors( $this->suppress );
    2626        }
    2727
  • branches/4.1/tests/phpunit/tests/option/multisite.php

    r29916 r32147  
    2323        function tearDown() {
    2424                global $wpdb;
     25                $wpdb->suppress_errors( $this->suppress );
    2526                parent::tearDown();
    26                 $wpdb->suppress_errors( $this->suppress );
    2727        }
    2828
  • branches/4.1/tests/phpunit/tests/post/meta.php

    r25002 r32147  
    3434
    3535        function tearDown() {
    36                 parent::tearDown();
    3736                wp_delete_post($this->post_id);
    3837                wp_delete_post($this->post_id_2);
     38                parent::tearDown();
    3939        }
    4040
  • branches/4.1/tests/phpunit/tests/post/revisions.php

    r30511 r32147  
    1313
    1414        function tearDown() {
     15                unset( $GLOBALS['wp_post_types'][ $this->post_type ] );
    1516                parent::tearDown();
    16                 unset( $GLOBALS['wp_post_types'][ $this->post_type ] );
    1717        }
    1818
  • branches/4.1/tests/phpunit/tests/query/conditionals.php

    r29932 r32147  
    3535        function tearDown() {
    3636                global $wp_rewrite;
     37                $wp_rewrite->init();
     38
    3739                parent::tearDown();
    38                 $wp_rewrite->init();
    3940        }
    4041
  • branches/4.1/tests/phpunit/tests/query/search.php

    r27474 r32147  
    1919
    2020        function tearDown() {
    21                 parent::tearDown();
    22 
    2321                _unregister_post_type( $this->post_type );
    2422                unset( $this->q );
     23
     24                parent::tearDown();
    2525        }
    2626
  • branches/4.1/tests/phpunit/tests/rewrite.php

    r28966 r32147  
    2323        function tearDown() {
    2424                global $wp_rewrite;
     25                $wp_rewrite->init();
     26
    2527                parent::tearDown();
    26                 $wp_rewrite->init();
    2728        }
    2829
  • branches/4.1/tests/phpunit/tests/shortcode.php

    r30290 r32147  
    2121        function tearDown() {
    2222                global $shortcode_tags;
    23                 parent::tearDown();
    2423                foreach ( $this->shortcodes as $shortcode )
    2524                        unset( $shortcode_tags[ $shortcode ] );
     25                parent::tearDown();
    2626        }
    2727
  • branches/4.1/tests/phpunit/tests/user/countUserPosts.php

    r30512 r32147  
    5858
    5959        public function tearDown() {
     60                _unregister_post_type( 'wptests_pt' );
    6061                parent::tearDown();
    61                 _unregister_post_type( 'wptests_pt' );
    6262        }
    6363
  • branches/4.1/tests/phpunit/tests/user/mapMetaCap.php

    r27390 r32147  
    3333
    3434        function tearDown() {
    35                 parent::tearDown();
    36 
    3735                $GLOBALS['super_admins'] = $this->super_admins;
    3836                unset( $GLOBALS['wp_post_types'][ $this->post_type ] );
     37                parent::tearDown();
    3938        }
    4039
  • branches/4.1/tests/phpunit/tests/user/multisite.php

    r29937 r32147  
    2323        function tearDown() {
    2424                global $wpdb;
     25                $wpdb->suppress_errors( $this->suppress );
    2526                parent::tearDown();
    26                 $wpdb->suppress_errors( $this->suppress );
    2727        }
    2828
  • branches/4.1/tests/phpunit/tests/xmlrpc/wp/getPage.php

    r25002 r32147  
    2525
    2626        function tearDown() {
     27                wp_delete_post( $this->post_id );
    2728                parent::tearDown();
    28 
    29                 wp_delete_post( $this->post_id );
    3029        }
    3130
Note: See TracChangeset for help on using the changeset viewer.