Changeset 5890
- Timestamp:
- 08/07/2015 09:54:05 AM (9 years ago)
- Location:
- trunk/tests/phpunit/testcases
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/replies/template/authors.php
r5723 r5890 28 28 public function test_bbp_get_reply_author_id() { 29 29 $u = $this->factory->user->create(); 30 $t = $this->factory->topic->create(); 30 31 $r = $this->factory->reply->create( array( 32 'post_parent' => $t, 31 33 'post_author' => $u, 34 'reply_meta' => array( 35 'topic_id' => $t, 36 ), 32 37 ) ); 33 38 … … 44 49 'display_name' => 'Barry B. Benson', 45 50 ) ); 46 51 $t = $this->factory->topic->create(); 47 52 $r = $this->factory->reply->create( array( 53 'post_parent' => $t, 48 54 'post_author' => $u, 55 'reply_meta' => array( 56 'topic_id' => $t, 57 ), 49 58 ) ); 50 59 -
trunk/tests/phpunit/testcases/replies/template/post_type.php
r5746 r5890 15 15 */ 16 16 public function test_bbp_reply_post_type() { 17 $r = $this->factory->reply->create(); 17 $t = $this->factory->topic->create(); 18 19 $r = $this->factory->reply->create( array( 20 'post_parent' => $t, 21 'reply_meta' => array( 22 'topic_id' => $t, 23 ), 24 ) ); 18 25 19 26 $robj = get_post_type_object( 'reply' ); -
trunk/tests/phpunit/testcases/users/functions/counts.php
r5741 r5890 135 135 $u = $this->factory->user->create(); 136 136 137 $t = $this->factory->topic->create(); 138 137 139 $has_replies = bbp_get_user_replies_created( $u ); 138 140 $this->assertFalse( $has_replies ); 139 141 140 $r = $this->factory->reply->create _many( 3,array(141 'post_ author' => $u,142 ) );143 144 bbp_update_reply( array(145 'reply_id' => $r,142 $r = $this->factory->reply->create( array( 143 'post_parent' => $t, 144 'post_author' => $u, 145 'reply_meta' => array( 146 'topic_id' => $t, 147 ), 146 148 ) ); 147 149 … … 189 191 $u = $this->factory->user->create(); 190 192 193 $t = $this->factory->topic->create(); 194 191 195 $r = $this->factory->reply->create_many( 3, array( 192 'post_author' => $u, 196 'post_parent' => $t, 197 'post_author' => $u, 198 'reply_meta' => array( 199 'topic_id' => $t, 200 ), 193 201 ) ); 194 202 … … 197 205 198 206 $r = $this->factory->reply->create_many( 3, array( 199 'post_author' => $u, 207 'post_parent' => $t, 208 'post_author' => $u, 209 'reply_meta' => array( 210 'topic_id' => $t, 211 ), 200 212 ) ); 201 213 … … 282 294 $r = $this->factory->reply->create_many( $int_value, array( 283 295 'post_parent' => $t, 296 'post_author' => $u, 297 'reply_meta' => array( 298 'topic_id' => $t, 299 ), 284 300 ) ); 285 301 … … 298 314 $integer = true; 299 315 300 bbp_ bump_user_topic_count( $u, $int_value );316 bbp_update_user_topic_count( $u, $int_value ); 301 317 302 318 $count = bbp_get_user_topic_count( $u, $integer ); … … 325 341 public function test_bbp_decrease_user_reply_count() { 326 342 $u = $this->factory->user->create(); 327 328 bbp_bump_user_reply_count( $u, 3 ); 329 330 $count = bbp_get_user_reply_count( $u, true ); 331 $this->assertSame( 3, $count ); 343 $int_value = 3; 344 $integer = true; 345 346 bbp_update_user_reply_count( $u, $int_value ); 347 348 $count = bbp_get_user_reply_count( $u, $integer ); 349 $this->assertSame( $int_value, $count ); 350 351 $t = $this->factory->topic->create(); 332 352 333 353 $r = $this->factory->reply->create( array( 334 'post_author' => $u, 335 ) ); 336 354 'post_parent' => $t, 355 'post_author' => $u, 356 'reply_meta' => array( 357 'topic_id' => $t, 358 ), 359 ) ); 360 361 // Minus 1 337 362 bbp_decrease_user_reply_count( $r ); 338 363 339 $count = bbp_get_user_reply_count( $u ); 340 $this->assertSame( '2', $count ); 341 364 $count = bbp_get_user_reply_count( $u, $integer ); 365 $this->assertSame( $int_value - 1, $count ); 366 367 // Minus 2 342 368 bbp_decrease_user_reply_count( $r ); 343 369 344 $count = bbp_get_user_reply_count( $u, true);345 $this->assertSame( 1, $count );370 $count = bbp_get_user_reply_count( $u, $integer ); 371 $this->assertSame( $int_value - 2, $count ); 346 372 } 347 373 }
Note: See TracChangeset
for help on using the changeset viewer.