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

    r12244 r12246  
    88    /**
    99     * @group bp_blogs_update_meta_cache
    10      * @expectedDeprecated wpmu_new_blog
    1110     */
    1211    public function test_bp_blogs_update_meta_cache() {
    1312        if ( ! is_multisite() ) {
    1413            $this->markTestSkipped();
     14        }
     15
     16        if ( function_exists( 'wp_initialize_site' ) ) {
     17            $this->setExpectedDeprecated( 'wpmu_new_blog' );
    1518        }
    1619
     
    9093     * @group bp_blogs_update_meta_cache
    9194     * @group bp_has_blogs
    92      * @expectedDeprecated wpmu_new_blog
    9395     */
    9496    public function test_bp_blogs_update_meta_cache_bp_has_blogs() {
    9597        if ( ! is_multisite() ) {
    9698            $this->markTestSkipped();
     99        }
     100
     101        if ( function_exists( 'wp_initialize_site' ) ) {
     102            $this->setExpectedDeprecated( 'wpmu_new_blog' );
    97103        }
    98104
     
    185191     * @group bp_blogs_update_meta_cache
    186192     * @group bp_has_blogs
    187      * @expectedDeprecated wpmu_new_blog
    188193     */
    189194    public function test_bp_blogs_update_meta_cache_bp_has_blogs_false() {
    190195        if ( ! is_multisite() ) {
    191196            $this->markTestSkipped();
     197        }
     198
     199        if ( function_exists( 'wp_initialize_site' ) ) {
     200            $this->setExpectedDeprecated( 'wpmu_new_blog' );
    192201        }
    193202
     
    261270    /**
    262271     * @group bp_blogs_total_blogs
    263      * @expectedDeprecated wpmu_new_blog
    264272     * @expectedDeprecated delete_blog
    265273     */
     
    267275        if ( ! is_multisite() ) {
    268276            $this->markTestSkipped();
     277        }
     278
     279        if ( function_exists( 'wp_initialize_site' ) ) {
     280            $this->setExpectedDeprecated( 'wpmu_new_blog' );
     281            $this->setExpectedDeprecated( 'delete_blog' );
    269282        }
    270283
     
    297310    /**
    298311     * @group update_blog_details
    299      * @expectedDeprecated wpmu_new_blog
    300312     */
    301313    public function test_update_blog_details_should_purge_blogmeta_cache() {
    302314        if ( ! is_multisite() ) {
    303315            $this->markTestSkipped();
     316        }
     317
     318        if ( function_exists( 'wp_initialize_site' ) ) {
     319            $this->setExpectedDeprecated( 'wpmu_new_blog' );
    304320        }
    305321
Note: See TracChangeset for help on using the changeset viewer.