Make WordPress Core

Changeset 928 in tests for trunk/tests/xmlrpc/wp/uploadFile.php


Ignore:
Timestamp:
07/19/2012 07:46:53 PM (14 years ago)
Author:
markoheijnen
Message:

XMLRPC: Fix wp.uploadFile->test_network_limit() so it also runs for single site

File:
1 edited

Legend:

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

    r911 r928  
    3333     */
    3434    function test_network_limit() {
     35        $this->make_user_by_role( 'editor' );
     36
     37        update_option( 'blog_upload_space', 0.1 );
     38
     39        // create attachment
     40        $filename = ( DIR_TESTDATA.'/images/canola.jpg' );
     41        $contents = file_get_contents( $filename );
     42        $data = array(
     43            'name' => 'a2-small.jpg',
     44            'type' => 'image/jpeg',
     45            'bits' => base64_encode( $contents )
     46        );
     47
     48        $result = $this->myxmlrpcserver->mw_newMediaObject( array( 0, 'editor', 'editor', $data ) );
     49
     50        // Only multisite should have a limit
    3551        if ( is_multisite() ) {
    36             $this->make_user_by_role( 'editor' );
    37 
    38             update_option( 'blog_upload_space', 0.1 );
    39 
    40             // create attachment
    41             $filename = ( DIR_TESTDATA.'/images/canola.jpg' );
    42             $contents = file_get_contents( $filename );
    43             $data = array(
    44                 'name' => 'a2-small.jpg',
    45                 'type' => 'image/jpeg',
    46                 'bits' => base64_encode( $contents )
    47             );
    48 
    49             $result = $this->myxmlrpcserver->mw_newMediaObject( array( 0, 'editor', 'editor', $data ) );
    5052            $this->assertInstanceOf( 'IXR_Error', $result );
    5153        }
     54        else {
     55            $this->assertNotInstanceOf( 'IXR_Error', $result );
     56        }
     57
    5258    }
    5359}
Note: See TracChangeset for help on using the changeset viewer.