Changeset 39189 for trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php
- Timestamp:
- 11/10/2016 01:53:08 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php
r35309 r39189 5 5 */ 6 6 class Tests_XMLRPC_wp_getMediaItem extends WP_XMLRPC_UnitTestCase { 7 var $post_id; 7 protected static $post_id; 8 8 9 var $attachment_data; 9 10 var $attachment_id; 11 12 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 13 self::$post_id = $factory->post->create(); 14 } 10 15 11 16 function setUp() { … … 14 19 add_theme_support( 'post-thumbnails' ); 15 20 16 $this->post_id = wp_insert_post( array(17 'post_title' => rand_str(),18 'post_content' => rand_str(),19 'post_status' => 'publish'20 ));21 22 21 $filename = ( DIR_TESTDATA.'/images/waffles.jpg' ); 23 22 $contents = file_get_contents( $filename ); 24 23 $upload = wp_upload_bits(basename($filename), null, $contents); 25 24 26 $this->attachment_id = $this->_make_attachment( $upload, $this->post_id );25 $this->attachment_id = $this->_make_attachment( $upload, self::$post_id ); 27 26 $this->attachment_data = get_post( $this->attachment_id, ARRAY_A ); 28 27 29 set_post_thumbnail( $this->post_id, $this->attachment_id );28 set_post_thumbnail( self::$post_id, $this->attachment_id ); 30 29 } 31 30
Note: See TracChangeset
for help on using the changeset viewer.