Changeset 38651 for trunk/tests/phpunit/tests/user/wpDropdownUsers.php
- Timestamp:
- 09/25/2016 05:44:24 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/wpDropdownUsers.php
r35790 r38651 111 111 $this->assertContains( $user1->user_login, $found ); 112 112 } 113 114 /** 115 * @ticket 38135 116 */ 117 public function test_role() { 118 $u1 = self::factory()->user->create_and_get( array( 'role' => 'subscriber' ) ); 119 $u2 = self::factory()->user->create_and_get( array( 'role' => 'author' ) ); 120 121 $found = wp_dropdown_users( array( 122 'echo' => false, 123 'role' => 'author', 124 'show' => 'user_login', 125 ) ); 126 127 $this->assertNotContains( $u1->user_login, $found ); 128 $this->assertContains( $u2->user_login, $found ); 129 } 130 131 /** 132 * @ticket 38135 133 */ 134 public function test_role__in() { 135 $u1 = self::factory()->user->create_and_get( array( 'role' => 'subscriber' ) ); 136 $u2 = self::factory()->user->create_and_get( array( 'role' => 'author' ) ); 137 138 $found = wp_dropdown_users( array( 139 'echo' => false, 140 'role__in' => array( 'author', 'editor' ), 141 'show' => 'user_login', 142 ) ); 143 144 $this->assertNotContains( $u1->user_login, $found ); 145 $this->assertContains( $u2->user_login, $found ); 146 } 147 148 /** 149 * @ticket 38135 150 */ 151 public function test_role__not_in() { 152 $u1 = self::factory()->user->create_and_get( array( 'role' => 'subscriber' ) ); 153 $u2 = self::factory()->user->create_and_get( array( 'role' => 'author' ) ); 154 155 $found = wp_dropdown_users( array( 156 'echo' => false, 157 'role__not_in' => array( 'subscriber', 'editor' ), 158 'show' => 'user_login', 159 ) ); 160 161 $this->assertNotContains( $u1->user_login, $found ); 162 $this->assertContains( $u2->user_login, $found ); 163 } 113 164 }
Note: See TracChangeset
for help on using the changeset viewer.