Changeset 42343 for trunk/tests/phpunit/tests/xmlrpc/wp/getPages.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/xmlrpc/wp/getPages.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/xmlrpc/wp/getPages.php
r40417 r42343 9 9 10 10 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 11 self::$post_id = $factory->post->create( array( 12 'post_type' => 'page', 13 'post_author' => $factory->user->create( array( 14 'user_login' => 'administrator', 15 'user_pass' => 'administrator', 16 'role' => 'administrator' 17 ) ), 18 'post_date' => strftime( "%Y-%m-%d %H:%M:%S", strtotime( '+1 day' ) ), 19 ) ); 20 self::$editor_id = $factory->user->create( array( 21 'user_login' => 'editor', 22 'user_pass' => 'editor', 23 'role' => 'editor' 24 ) ); 11 self::$post_id = $factory->post->create( 12 array( 13 'post_type' => 'page', 14 'post_author' => $factory->user->create( 15 array( 16 'user_login' => 'administrator', 17 'user_pass' => 'administrator', 18 'role' => 'administrator', 19 ) 20 ), 21 'post_date' => strftime( '%Y-%m-%d %H:%M:%S', strtotime( '+1 day' ) ), 22 ) 23 ); 24 self::$editor_id = $factory->user->create( 25 array( 26 'user_login' => 'editor', 27 'user_pass' => 'editor', 28 'role' => 'editor', 29 ) 30 ); 25 31 } 26 32 … … 43 49 $this->assertNotIXRError( $results ); 44 50 45 foreach ( $results as $result ) {51 foreach ( $results as $result ) { 46 52 $page = get_post( $result['page_id'] ); 47 53 $this->assertEquals( $page->post_type, 'page' ); … … 63 69 */ 64 70 function test_semi_capable_user() { 65 add_filter( 'map_meta_cap', array( $this, 'remove_editor_edit_page_cap' ), 10, 4 );71 add_filter( 'map_meta_cap', array( $this, 'remove_editor_edit_page_cap' ), 10, 4 ); 66 72 67 73 $results = $this->myxmlrpcserver->wp_getPages( array( 1, 'editor', 'editor' ) ); … … 69 75 70 76 $found_incapable = false; 71 foreach ( $results as $result ) {77 foreach ( $results as $result ) { 72 78 // WP#20629 73 79 $this->assertNotIXRError( $result );
Note: See TracChangeset
for help on using the changeset viewer.