diff --git a/tests/phpunit/tests/user/capabilities.php b/tests/phpunit/tests/user/capabilities.php
index 86d70c3ea2..26ae4c830f 100644
|
a
|
b
|
class Tests_User_Capabilities extends WP_UnitTestCase { |
| 1572 | 1572 | $user->remove_cap( 'publish_posts' ); |
| 1573 | 1573 | $this->assertFalse( $user->has_cap( 'publish_posts' ) ); |
| 1574 | 1574 | } |
| 1575 | | |
| | 1575 | /** |
| | 1576 | * @group santilin |
| | 1577 | */ |
| 1576 | 1578 | function test_subscriber_cant_edit_posts() { |
| 1577 | 1579 | $user = self::$users['subscriber']; |
| 1578 | 1580 | wp_set_current_user( $user->ID ); |
| … |
… |
class Tests_User_Capabilities extends WP_UnitTestCase { |
| 1580 | 1582 | $post = self::factory()->post->create( array( 'post_author' => 1 ) ); |
| 1581 | 1583 | |
| 1582 | 1584 | $this->assertFalse( current_user_can( 'edit_post', $post ) ); |
| | 1585 | $this->assertFalse( current_user_can_for_blog( get_current_blog_id(), 'edit_post', $post ) ); |
| | 1586 | $this->assertFalse( current_user_can( 'edit_post', $post + 1 ) ); |
| | 1587 | $this->assertFalse( current_user_can_for_blog( get_current_blog_id(), 'edit_post', $post + 1 ) ); |
| | 1588 | } |
| | 1589 | |
| | 1590 | /** |
| | 1591 | * @group santilin |
| | 1592 | */ |
| | 1593 | function test_editor_can_edit_posts() { |
| | 1594 | $user = self::$users['editor']; |
| | 1595 | wp_set_current_user( $user->ID ); |
| | 1596 | |
| | 1597 | $post = self::factory()->post->create( array( 'post_author' => $user->ID ) ); |
| | 1598 | |
| | 1599 | $this->assertTrue( current_user_can( 'edit_post', $post ) ); |
| 1583 | 1600 | $this->assertFalse( current_user_can( 'edit_post', $post + 1 ) ); |
| | 1601 | $this->assertTrue( current_user_can_for_blog( get_current_blog_id(), 'edit_post', $post ) ); |
| | 1602 | $this->assertFalse( current_user_can_for_blog( get_current_blog_id(), 'edit_post', $post + 1 ) ); |
| | 1603 | // The following assert fails when it shouldnt |
| | 1604 | $this->assertFalse( current_user_can_for_blog( 12345, 'edit_post', $post ) ); |
| | 1605 | $this->assertFalse( current_user_can_for_blog( 12345, 'edit_post', $post + 1 ) ); |
| 1584 | 1606 | } |
| 1585 | 1607 | |
| 1586 | 1608 | /** |