|
@@ 639-655 (lines=17) @@
|
| 636 |
|
$this->assertSame(array( 'author' => true ), $user->caps); |
| 637 |
|
} |
| 638 |
|
|
| 639 |
|
public function test_roles_and_caps_should_be_populated_for_explicit_value_of_blog_id_on_nonms() |
| 640 |
|
{ |
| 641 |
|
if (is_multisite() ) { |
| 642 |
|
$this->markTestSkipped(__METHOD__ . ' is a non-multisite-only test.'); |
| 643 |
|
} |
| 644 |
|
|
| 645 |
|
$query = new WP_User_Query( |
| 646 |
|
array( |
| 647 |
|
'include' => self::$author_ids[0], |
| 648 |
|
'blog_id' => get_current_blog_id(), |
| 649 |
|
) |
| 650 |
|
); |
| 651 |
|
|
| 652 |
|
$found = $query->get_results(); |
| 653 |
|
|
| 654 |
|
$this->assertNotEmpty($found); |
| 655 |
|
$user = reset($found); |
| 656 |
|
$this->assertSame(array( 'author' ), $user->roles); |
| 657 |
|
$this->assertSame(array( 'author' => true ), $user->caps); |
| 658 |
|
} |
|
@@ 660-676 (lines=17) @@
|
| 657 |
|
$this->assertSame(array( 'author' => true ), $user->caps); |
| 658 |
|
} |
| 659 |
|
|
| 660 |
|
public function test_roles_and_caps_should_be_populated_for_explicit_value_of_current_blog_id_on_ms() |
| 661 |
|
{ |
| 662 |
|
if (! is_multisite() ) { |
| 663 |
|
$this->markTestSkipped(__METHOD__ . ' is a multisite-only test.'); |
| 664 |
|
} |
| 665 |
|
|
| 666 |
|
$query = new WP_User_Query( |
| 667 |
|
array( |
| 668 |
|
'include' => self::$author_ids[0], |
| 669 |
|
'blog_id' => get_current_blog_id(), |
| 670 |
|
) |
| 671 |
|
); |
| 672 |
|
|
| 673 |
|
$found = $query->get_results(); |
| 674 |
|
|
| 675 |
|
$this->assertNotEmpty($found); |
| 676 |
|
$user = reset($found); |
| 677 |
|
$this->assertSame(array( 'author' ), $user->roles); |
| 678 |
|
$this->assertSame(array( 'author' => true ), $user->caps); |
| 679 |
|
} |