Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/05/2018 05:24:17 PM (6 years ago)
Author:
boonebgorges
Message:

Tests: Move wpmu_new_blog and delete_blog expectedDeprecated calls into test logic.

Use of the @expectedDeprecated annotation means that the deprecation notice is
expected across all versions of WordPress, while we in fact need to suppress the
notices only on WP 5.0+.

See #7984.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/blogs/class-bp-blogs-blog.php

    r12244 r12246  
    66 */
    77class BP_Tests_BP_Blogs_Blog_TestCases extends BP_UnitTestCase {
    8     /**
    9      * @expectedDeprecated wpmu_new_blog
    10      */
    118    public function test_get_with_search_terms() {
    129        if ( ! is_multisite() ) {
    1310            $this->markTestSkipped();
     11        }
     12
     13        if ( function_exists( 'wp_initialize_site' ) ) {
     14            $this->setExpectedDeprecated( 'wpmu_new_blog' );
    1415        }
    1516
     
    3536    /**
    3637     * @ticket BP5858
    37      * @expectedDeprecated wpmu_new_blog
    3838     */
    3939    public function test_get_with_search_terms_should_match_description() {
    4040        if ( ! is_multisite() ) {
    4141            $this->markTestSkipped();
     42        }
     43
     44        if ( function_exists( 'wp_initialize_site' ) ) {
     45            $this->setExpectedDeprecated( 'wpmu_new_blog' );
    4246        }
    4347
     
    6468    }
    6569
    66     /**
    67      * @expectedDeprecated wpmu_new_blog
    68      */
    6970    public function test_search_blogs() {
    7071        if ( ! is_multisite() ) {
    7172            $this->markTestSkipped();
     73        }
     74
     75        if ( function_exists( 'wp_initialize_site' ) ) {
     76            $this->setExpectedDeprecated( 'wpmu_new_blog' );
    7277        }
    7378
     
    9499    /**
    95100     * @group get_by_letter
    96      * @expectedDeprecated wpmu_new_blog
    97101     */
    98102    public function test_get_by_letter() {
     
    100104            $this->markTestSkipped();
    101105            return;
     106        }
     107
     108        if ( function_exists( 'wp_initialize_site' ) ) {
     109            $this->setExpectedDeprecated( 'wpmu_new_blog' );
    102110        }
    103111
     
    124132    /**
    125133     * @group get_order_by
    126      * @expectedDeprecated wpmu_new_blog
    127134     */
    128135    public function test_get_order_by() {
    129136        if ( ! is_multisite() ) {
    130137            $this->markTestSkipped();
     138        }
     139
     140        if ( function_exists( 'wp_initialize_site' ) ) {
     141            $this->setExpectedDeprecated( 'wpmu_new_blog' );
    131142        }
    132143
Note: See TracChangeset for help on using the changeset viewer.