Changeset 5741
- Timestamp:
- 05/13/2015 03:44:00 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/users/functions/counts.php
r5708 r5741 15 15 function test_bbp_update_user_topic_count() { 16 16 $u = $this->factory->user->create(); 17 $int_value = 9;17 $int_value = 3; 18 18 19 19 bbp_update_user_topic_count( $u, $int_value ); … … 28 28 function test_bbp_update_user_reply_count() { 29 29 $u = $this->factory->user->create(); 30 $int_value = 9;30 $int_value = 3; 31 31 32 32 bbp_update_user_reply_count( $u, $int_value ); … … 42 42 function test_bbp_get_user_topic_count() { 43 43 $u = $this->factory->user->create(); 44 $int_value = 9;44 $int_value = 3; 45 45 $formatted_value = bbp_number_format( $int_value ); 46 46 … … 63 63 function test_bbp_get_user_reply_count() { 64 64 $u = $this->factory->user->create(); 65 $int_value = 9;65 $int_value = 3; 66 66 $formatted_value = bbp_number_format( $int_value ); 67 67 … … 84 84 function test_bbp_get_user_post_count() { 85 85 $u = $this->factory->user->create(); 86 $int_value = 9;86 $int_value = 3; 87 87 $integer = true; 88 88 … … 117 117 $this->assertFalse( $has_topics ); 118 118 119 $t = $this->factory->topic->create_many( 15, array(119 $t = $this->factory->topic->create_many( 3, array( 120 120 'post_author' => $u, 121 121 ) ); … … 138 138 $this->assertFalse( $has_replies ); 139 139 140 $r = $this->factory->reply->create_many( 15, array(140 $r = $this->factory->reply->create_many( 3, array( 141 141 'post_author' => $u, 142 142 ) ); … … 154 154 */ 155 155 public function test_bbp_get_total_users() { 156 $this->factory->user->create_many( 15);156 $this->factory->user->create_many( 3 ); 157 157 158 158 $users = (int) bbp_get_total_users(); 159 159 160 160 // 15 + 1, the + 1 is the default admin user 161 $this->assertSame( 16, $users );161 $this->assertSame( 4, $users ); 162 162 } 163 163 … … 168 168 $u = $this->factory->user->create(); 169 169 170 $t = $this->factory->topic->create_many( 15, array(170 $t = $this->factory->topic->create_many( 3, array( 171 171 'post_author' => $u, 172 172 ) ); 173 173 174 174 $count = bbp_get_user_topic_count_raw( $u ); 175 $this->assertSame( 15, $count );176 177 $t = $this->factory->topic->create_many( 15, array(175 $this->assertSame( 3, $count ); 176 177 $t = $this->factory->topic->create_many( 3, array( 178 178 'post_author' => $u, 179 179 ) ); 180 180 181 181 $count = bbp_get_user_topic_count_raw( $u ); 182 $this->assertSame( 30, $count );182 $this->assertSame( 6, $count ); 183 183 } 184 184 … … 189 189 $u = $this->factory->user->create(); 190 190 191 $r = $this->factory->reply->create_many( 15, array(191 $r = $this->factory->reply->create_many( 3, array( 192 192 'post_author' => $u, 193 193 ) ); 194 194 195 195 $count = bbp_get_user_reply_count_raw( $u ); 196 $this->assertSame( 15, $count );197 198 $r = $this->factory->reply->create_many( 15, array(196 $this->assertSame( 3, $count ); 197 198 $r = $this->factory->reply->create_many( 3, array( 199 199 'post_author' => $u, 200 200 ) ); 201 201 202 202 $count = bbp_get_user_reply_count_raw( $u ); 203 $this->assertSame( 30, $count );203 $this->assertSame( 6, $count ); 204 204 } 205 205 … … 209 209 public function test_bbp_bump_user_topic_count() { 210 210 $u = $this->factory->user->create(); 211 $int_value = 9;211 $int_value = 3; 212 212 $integer = true; 213 213 … … 228 228 public function test_bbp_bump_user_reply_count() { 229 229 $u = $this->factory->user->create(); 230 $int_value = 9;230 $int_value = 3; 231 231 $integer = true; 232 232 … … 247 247 public function test_bbp_increase_user_topic_count() { 248 248 $u = $this->factory->user->create(); 249 $int_value = 9;249 $int_value = 3; 250 250 $integer = true; 251 251 … … 270 270 public function test_bbp_increase_user_reply_count() { 271 271 $u = $this->factory->user->create(); 272 $int_value = 9;272 $int_value = 3; 273 273 $integer = true; 274 274 … … 295 295 public function test_bbp_decrease_user_topic_count() { 296 296 $u = $this->factory->user->create(); 297 $int_value = 9;297 $int_value = 3; 298 298 $integer = true; 299 299 … … 326 326 $u = $this->factory->user->create(); 327 327 328 bbp_bump_user_reply_count( $u, 15);328 bbp_bump_user_reply_count( $u, 3 ); 329 329 330 330 $count = bbp_get_user_reply_count( $u, true ); 331 $this->assertSame( 15, $count );331 $this->assertSame( 3, $count ); 332 332 333 333 $r = $this->factory->reply->create( array( … … 338 338 339 339 $count = bbp_get_user_reply_count( $u ); 340 $this->assertSame( ' 14', $count );340 $this->assertSame( '2', $count ); 341 341 342 342 bbp_decrease_user_reply_count( $r ); 343 343 344 344 $count = bbp_get_user_reply_count( $u, true ); 345 $this->assertSame( 1 3, $count );345 $this->assertSame( 1, $count ); 346 346 } 347 347 }
Note: See TracChangeset
for help on using the changeset viewer.