Changeset 32001 for trunk/tests/phpunit/tests/user/query.php
- Timestamp:
- 04/03/2015 02:13:19 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/query.php
r32000 r32001 600 600 $this->assertSame( array( 'author' => true ), $user->caps ); 601 601 } 602 603 /** 604 * @ticket 31878 605 */ 606 public function test_roles_and_caps_should_be_populated_for_explicit_value_of_different_blog_id_on_ms_when_fields_all() { 607 if ( ! is_multisite() ) { 608 $this->markTestSkipped( __METHOD__ . ' is a multisite-only test.' ); 609 } 610 611 $b = $this->factory->blog->create(); 612 $u = $this->factory->user->create(); 613 add_user_to_blog( $b, $u, 'author' ); 614 615 $query = new WP_User_Query( array( 616 'fields' => 'all', 617 'include' => $u, 618 'blog_id' => $b, 619 ) ); 620 621 $found = $query->get_results(); 622 623 $this->assertNotEmpty( $found ); 624 $user = reset( $found ); 625 $this->assertSame( array( 'author' ), $user->roles ); 626 $this->assertSame( array( 'author' => true ), $user->caps ); 627 } 602 628 }
Note: See TracChangeset
for help on using the changeset viewer.