Make WordPress Core

Changeset 910 in tests


Ignore:
Timestamp:
07/19/2012 02:13:30 AM (14 years ago)
Author:
markoheijnen
Message:

XMLRPC: Added test to check limit for wp.uploadFile, see WP#21292

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/xmlrpc/wp/uploadFile.php

    r904 r910  
    33/**
    44 * @group xmlrpc
     5 * @group marko
    56 */
    67class Tests_XMLRPC_wp_uploadFile extends WP_XMLRPC_UnitTestCase {
     
    2829                $this->assertInternalType( 'string', $result['type'] );
    2930        }
     31
     32        /**
     33         * @ticket 21292
     34         */
     35        function test_network_limit() {
     36                if ( is_multisite() ) {
     37                        $this->make_user_by_role( 'editor' );
     38
     39                        update_option( 'blog_upload_space', 0.1 );
     40
     41                        // create attachment
     42                        $filename = ( DIR_TESTDATA.'/images/canola.jpg' );
     43                        $contents = file_get_contents( $filename );
     44                        $data = array(
     45                                'name' => 'a2-small.jpg',
     46                                'type' => 'image/jpeg',
     47                                'bits' => base64_encode( $contents )
     48                        );
     49
     50                        $result = $this->myxmlrpcserver->mw_newMediaObject( array( 0, 'editor', 'editor', $data ) );
     51                        $this->assertInstanceOf( 'IXR_Error', $result );
     52                }
     53        }
    3054}
Note: See TracChangeset for help on using the changeset viewer.