- Timestamp:
- 02/21/2020 01:05:39 PM (5 years ago)
- Location:
- branches/3.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.8
- Property svn:mergeinfo changed
-
branches/3.8/tests/phpunit/tests/xmlrpc/wp/uploadFile.php
r25002 r47338 30 30 } 31 31 32 /**33 * @ticket 2129234 */35 function test_network_limit() {36 $this->make_user_by_role( 'editor' );37 38 update_option( 'blog_upload_space', 0.1 );39 40 // create attachment41 $filename = ( DIR_TESTDATA . '/images/canola.jpg' );42 $contents = file_get_contents( $filename );43 $data = array(44 'name' => 'canola.jpg',45 'type' => 'image/jpeg',46 'bits' => $contents47 );48 49 $result = $this->myxmlrpcserver->mw_newMediaObject( array( 0, 'editor', 'editor', $data ) );50 51 // Only multisite should have a limit52 if ( is_multisite() )53 $this->assertInstanceOf( 'IXR_Error', $result );54 else55 $this->assertNotInstanceOf( 'IXR_Error', $result );56 }57 58 /**59 * @ticket 1194660 */61 function test_valid_mime() {62 $this->make_user_by_role( 'editor' );63 64 // create attachment65 $filename = ( DIR_TESTDATA . '/images/test-image-mime-jpg.png' );66 $contents = file_get_contents( $filename );67 $data = array(68 'name' => 'test-image-mime-jpg.png',69 'type' => 'image/png',70 'bits' => $contents71 );72 73 $result = $this->myxmlrpcserver->mw_newMediaObject( array( 0, 'editor', 'editor', $data ) );74 75 $this->assertNotInstanceOf( 'IXR_Error', $result );76 77 $this->assertEquals( 'image/jpeg', $result['type'] );78 }79 32 }
Note: See TracChangeset
for help on using the changeset viewer.