Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/02/2015 08:55:07 PM (9 years ago)
Author:
imath
Message:

Make sure the BP Attachments API behaves the right way when WordPress < 4.0

Before WordPress 4.0, there was no dynamic filter based on the name of the action posted in the upload form. So we also need to filter wp_handle_upload_prefilter to make sure the BP_Attachments->validate_upload() function will actually validate the uploads for versions of WordPress < 4.0.

Improve the i18n of the avatar type error, as the avatar types can now be filtered in the BP_Attachment_Avatar class.

Add unit tests for the BP Attachement class.

Fixes #6278

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/core/functions.php

    r9819 r9831  
    599599        }
    600600    }
     601
     602    /**
     603     * @group bp_attachments
     604     * @group bp_upload_dir
     605     */
     606    public function test_bp_upload_dir_ms() {
     607        if ( ! is_multisite() ) {
     608            $this->markTestSkipped( __METHOD__ . ' is a multisite-only test.' );
     609        }
     610
     611        $expected_upload_dir = wp_upload_dir();
     612
     613        $b = $this->factory->blog->create();
     614
     615        switch_to_blog( $b );
     616
     617        $tested_upload_dir = bp_upload_dir();
     618
     619        restore_current_blog();
     620
     621        $this->assertSame( $expected_upload_dir, $tested_upload_dir );
     622    }
    601623}
Note: See TracChangeset for help on using the changeset viewer.