Changeset 35225 for trunk/tests/phpunit/tests/post/getPostsByAuthorSql.php
- Timestamp:
- 10/16/2015 09:04:12 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/getPostsByAuthorSql.php
r32524 r35225 60 60 public function test_public_only_true_should_not_allow_any_private_posts_for_loggedin_user(){ 61 61 $current_user = get_current_user_id(); 62 $u = $this->factory->user->create();62 $u = self::$factory->user->create(); 63 63 wp_set_current_user( $u ); 64 64 … … 71 71 public function test_public_only_should_default_to_false(){ 72 72 $current_user = get_current_user_id(); 73 $u = $this->factory->user->create();73 $u = self::$factory->user->create(); 74 74 wp_set_current_user( $u ); 75 75 … … 81 81 public function test_public_only_false_should_allow_current_user_access_to_own_private_posts_when_current_user_matches_post_author(){ 82 82 $current_user = get_current_user_id(); 83 $u = $this->factory->user->create();83 $u = self::$factory->user->create(); 84 84 wp_set_current_user( $u ); 85 85 … … 92 92 public function test_public_only_false_should_not_allow_access_to_private_posts_if_current_user_is_not_post_author(){ 93 93 $current_user = get_current_user_id(); 94 $u1 = $this->factory->user->create();95 $u2 = $this->factory->user->create();94 $u1 = self::$factory->user->create(); 95 $u2 = self::$factory->user->create(); 96 96 wp_set_current_user( $u1 ); 97 97 … … 104 104 public function test_public_only_false_should_allow_current_user_access_to_own_private_posts_when_post_author_is_not_provided(){ 105 105 $current_user = get_current_user_id(); 106 $u = $this->factory->user->create();106 $u = self::$factory->user->create(); 107 107 wp_set_current_user( $u ); 108 108 … … 116 116 public function test_administrator_should_have_access_to_private_posts_when_public_only_is_false(){ 117 117 $current_user = get_current_user_id(); 118 $u = $this->factory->user->create( array( 'role' => 'administrator' ) );118 $u = self::$factory->user->create( array( 'role' => 'administrator' ) ); 119 119 wp_set_current_user( $u ); 120 120 … … 131 131 register_post_type( 'baz', array( 'capabilities' => array( 'read_private_posts' => 'read_private_baz' ) ) ); 132 132 $current_user = get_current_user_id(); 133 $u = $this->factory->user->create( array( 'role' => 'editor' ) );133 $u = self::$factory->user->create( array( 'role' => 'editor' ) ); 134 134 $editor_role = get_role('editor'); 135 135 $editor_role->add_cap( 'read_private_baz' );
Note: See TracChangeset
for help on using the changeset viewer.