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/functions.php

    r12245 r12246  
    282282    /**
    283283     * @group bp_blogs_restore_data
    284      * @expectedDeprecated wpmu_new_blog
    285284     */
    286285    public function test_bp_blogs_restore_data() {
    287286        if ( ! is_multisite() ) {
    288287            $this->markTestSkipped();
     288        }
     289
     290        if ( function_exists( 'wp_initialize_site' ) ) {
     291            $this->setExpectedDeprecated( 'wpmu_new_blog' );
    289292        }
    290293
     
    888891    public function test_bp_blogs_comment_sync_activity_comment_for_custom_post_type() {
    889892        if ( is_multisite() ) {
    890             $this->setExpectedDeprecated( 'wpmu_new_blog' );
     893            if ( function_exists( 'wp_initialize_site' ) ) {
     894                $this->setExpectedDeprecated( 'wpmu_new_blog' );
     895            }
     896
    891897            $b = self::factory()->blog->create();
    892898            switch_to_blog( $b );
     
    989995    /**
    990996     * @group bp_blogs_record_existing_blogs
    991      * @expectedDeprecated wpmu_new_blog
    992997     */
    993998    public function test_bp_blogs_record_existing_blogs_limit() {
     
    9961001        }
    9971002
     1003        if ( function_exists( 'wp_initialize_site' ) ) {
     1004            $this->setExpectedDeprecated( 'wpmu_new_blog' );
     1005        }
     1006
    9981007        $old_user = get_current_user_id();
    9991008
     
    10221031    /**
    10231032     * @group bp_blogs_remove_blog
    1024      * @expectedDeprecated wpmu_new_blog
    1025      * @expectedDeprecated delete_blog
    10261033     */
    10271034    public function test_bp_blogs_remove_blog() {
    10281035        if ( ! is_multisite() ) {
    10291036            $this->markTestSkipped();
     1037        }
     1038
     1039        if ( function_exists( 'wp_initialize_site' ) ) {
     1040            $this->setExpectedDeprecated( 'wpmu_new_blog' );
     1041            $this->setExpectedDeprecated( 'delete_blog' );
    10301042        }
    10311043
     
    10711083    /**
    10721084     * @group bp_blogs_remove_blog_for_user
    1073      * @expectedDeprecated wpmu_new_blog
    10741085     */
    10751086    public function test_bp_blogs_remove_blog_for_user_is_contributor() {
    10761087        if ( ! is_multisite() ) {
    10771088            $this->markTestSkipped();
     1089        }
     1090
     1091        if ( function_exists( 'wp_initialize_site' ) ) {
     1092            $this->setExpectedDeprecated( 'wpmu_new_blog' );
    10781093        }
    10791094
Note: See TracChangeset for help on using the changeset viewer.