Skip to:
Content

BuddyPress.org

Changeset 14067


Ignore:
Timestamp:
10/31/2024 05:12:29 AM (4 months ago)
Author:
imath
Message:

PHPUnit tests: improve the bp_attachments_get_allowed_types() test

Use a more meaningful test checking for document file types.

Fixes #9251
Closes https://github.com/buddypress/buddypress/pull/401

File:
1 edited

Legend:

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

    r13998 r14067  
    778778        $this->assertSame( $supported, $cover_image );
    779779
    780         $images = bp_attachments_get_allowed_types( 'image/' );
    781 
    782         foreach ( $images as $image ) {
    783             if ( 'image' !== wp_ext2type( $image ) ) {
    784                 $not_image = $image;
     780        $documents = bp_attachments_get_allowed_types( 'document' );
     781
     782        foreach ( $documents as $document ) {
     783            if ( 'document' !== wp_ext2type( $document ) ) {
     784                $not_document = $document;
    785785            }
    786786        }
    787787
    788         $this->assertTrue( empty( $not_image ) );
     788        $this->assertTrue( empty( $not_document ) );
    789789    }
    790790
Note: See TracChangeset for help on using the changeset viewer.