[ Index ] |
PHP Cross Reference of BBPress |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * Tests for the users component user template functions. 4 * 5 * @group users 6 * @group template 7 * @group user 8 */ 9 class BBP_Tests_Users_Template_User extends BBP_UnitTestCase { 10 11 protected $old_current_user = 0; 12 13 public function setUp() { 14 parent::setUp(); 15 $this->old_current_user = get_current_user_id(); 16 $this->set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) ); 17 $this->keymaster_id = get_current_user_id(); 18 $this->keymaster_userdata = get_userdata( $this->keymaster_id ); 19 bbp_set_user_role( $this->keymaster_id, bbp_get_keymaster_role() ); 20 } 21 22 public function tearDown() { 23 parent::tearDown(); 24 $this->set_current_user( $this->old_current_user ); 25 } 26 27 /** 28 * @covers ::bbp_user_id 29 * @covers ::bbp_get_user_id 30 */ 31 public function test_bbp_get_user_id() { 32 $int_value = $this->keymaster_userdata->ID; 33 $formatted_value = bbp_number_format( $int_value ); 34 35 // Integer. 36 $user_id = bbp_get_user_id( $this->keymaster_id ); 37 $this->assertSame( $this->keymaster_id, $user_id ); 38 39 // Output. 40 $this->expectOutputString( $formatted_value ); 41 bbp_user_id( $this->keymaster_id ); 42 } 43 44 /** 45 * @covers ::bbp_current_user_id 46 * @covers ::bbp_get_current_user_id 47 */ 48 public function test_bbp_get_current_user_id() { 49 $int_value = $this->keymaster_userdata->ID; 50 $formatted_value = bbp_number_format( $int_value ); 51 52 // Integer. 53 $user_id = bbp_get_current_user_id(); 54 $this->assertSame( $this->keymaster_id, $user_id ); 55 56 // Output. 57 $this->expectOutputString( $formatted_value ); 58 bbp_current_user_id( $this->keymaster_id ); 59 } 60 61 /** 62 * @covers ::bbp_displayed_user_id 63 * @covers ::bbp_get_displayed_user_id 64 * @todo Implement test_bbp_get_displayed_user_id(). 65 */ 66 public function test_bbp_get_displayed_user_id() { 67 // Remove the following lines when you implement this test. 68 $this->markTestIncomplete( 69 'This test has not been implemented yet.' 70 ); 71 } 72 73 /** 74 * @covers ::bbp_displayed_user_field 75 * @covers ::bbp_get_displayed_user_field 76 * @todo Implement test_bbp_get_displayed_user_field(). 77 */ 78 public function test_bbp_get_displayed_user_field() { 79 // Remove the following lines when you implement this test. 80 $this->markTestIncomplete( 81 'This test has not been implemented yet.' 82 ); 83 } 84 85 /** 86 * @covers ::bbp_current_user_name 87 * @covers ::bbp_get_current_user_name 88 */ 89 public function test_bbp_get_current_user_name() { 90 $current_user = wp_get_current_user(); 91 92 // String. 93 $user_id = bbp_get_current_user_name(); 94 $this->assertSame( $current_user->display_name, $user_id ); 95 96 // Output. 97 $this->expectOutputString( $current_user->display_name ); 98 bbp_current_user_name( $this->keymaster_id ); 99 } 100 101 /** 102 * @covers ::bbp_current_user_avatar 103 * @covers ::bbp_get_current_user_avatar 104 */ 105 public function test_bbp_get_current_user_avatar() { 106 $current_user = get_current_user_id(); 107 $size = 40; 108 $wp_avatar = get_avatar( $current_user, $size ); 109 110 // String. 111 $bbp_avatar = bbp_get_current_user_avatar( $size ); 112 $this->assertSame( $bbp_avatar, $wp_avatar ); 113 114 // Output. 115 $this->expectOutputString( $wp_avatar ); 116 bbp_current_user_avatar( $size ); 117 } 118 119 /** 120 * @covers ::bbp_user_profile_link 121 * @covers ::bbp_get_user_profile_link 122 */ 123 public function test_bbp_get_user_profile_link() { 124 $display_name = $this->keymaster_userdata->display_name; 125 126 // Pretty permalinks 127 $this->set_permalink_structure( '/%postname%/' ); 128 129 $profile_link = '<a href="http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/">' . $display_name . '</a>'; 130 $user_profile_link = bbp_get_user_profile_link( $this->keymaster_id ); 131 132 // String. 133 $this->assertSame( $profile_link, $user_profile_link ); 134 135 // Output. 136 $this->expectOutputString( $profile_link ); 137 bbp_user_profile_link( $this->keymaster_id ); 138 139 ob_clean(); 140 141 // Ugly permalinks 142 $this->set_permalink_structure(); 143 144 $profile_link = '<a href="http://' . WP_TESTS_DOMAIN . '/?bbp_user=' . $this->keymaster_id . '">' . $display_name . '</a>'; 145 $user_profile_link = bbp_get_user_profile_link( $this->keymaster_id ); 146 147 // String. 148 $this->assertSame( $profile_link, $user_profile_link ); 149 150 // Output. 151 $this->expectOutputString( $profile_link ); 152 bbp_user_profile_link( $this->keymaster_id ); 153 } 154 155 /** 156 * @covers ::bbp_user_nicename 157 * @covers ::bbp_get_user_nicename 158 */ 159 public function test_bbp_get_user_nicename() { 160 $user_nicename = $this->keymaster_userdata->user_nicename; 161 162 // String. 163 $this->assertSame( $user_nicename, bbp_get_user_nicename( $this->keymaster_id ) ); 164 165 // Output. 166 $this->expectOutputString( $user_nicename ); 167 bbp_user_nicename( $this->keymaster_id ); 168 } 169 170 /** 171 * @covers ::bbp_user_profile_url 172 * @covers ::bbp_get_user_profile_url 173 */ 174 public function test_bbp_get_user_profile_url() { 175 176 // Pretty permalinks 177 $this->set_permalink_structure( '/%postname%/' ); 178 $profile_url = 'http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/'; 179 $user_profile_url = bbp_get_user_profile_url( $this->keymaster_id ); 180 181 // String. 182 $this->assertSame( $profile_url, $user_profile_url ); 183 184 // Output. 185 $this->expectOutputString( $profile_url ); 186 bbp_user_profile_url( $this->keymaster_id ); 187 188 ob_clean(); 189 190 // Ugly permalinks 191 $this->set_permalink_structure(); 192 193 $profile_url = 'http://' . WP_TESTS_DOMAIN . '/?bbp_user=' . $this->keymaster_id; 194 $user_profile_url = bbp_get_user_profile_url( $this->keymaster_id ); 195 196 // String. 197 $this->assertSame( $profile_url, $user_profile_url ); 198 199 // Output. 200 $this->expectOutputString( $profile_url ); 201 bbp_user_profile_url( $this->keymaster_id ); 202 } 203 204 /** 205 * @covers ::bbp_user_profile_edit_link 206 * @covers ::bbp_get_user_profile_edit_link 207 */ 208 public function test_bbp_get_user_profile_edit_link() { 209 $display_name = $this->keymaster_userdata->display_name; 210 211 // Pretty permalinks 212 $this->set_permalink_structure( '/%postname%/' ); 213 $profile_edit_link = '<a href="http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/edit/">' . $display_name . '</a>'; 214 $user_profile_edit_link = bbp_get_user_profile_edit_link( $this->keymaster_id ); 215 216 // String. 217 $this->assertSame( $profile_edit_link, $user_profile_edit_link ); 218 219 // Output. 220 $this->expectOutputString( $profile_edit_link ); 221 bbp_user_profile_edit_link( $this->keymaster_id ); 222 223 ob_clean(); 224 225 // Ugly permalinks 226 $this->set_permalink_structure(); 227 $profile_edit_link = '<a href="http://' . WP_TESTS_DOMAIN . '/?bbp_user=' . $this->keymaster_id . '&edit=1">' . $display_name . '</a>'; 228 $user_profile_edit_link = bbp_get_user_profile_edit_link( $this->keymaster_id ); 229 230 // String. 231 $this->assertSame( $profile_edit_link, $user_profile_edit_link ); 232 233 // Output. 234 $this->expectOutputString( $profile_edit_link ); 235 bbp_user_profile_edit_link( $this->keymaster_id ); 236 } 237 238 /** 239 * @covers ::bbp_user_profile_edit_url 240 */ 241 public function test_bbp_user_profile_edit_url() { 242 243 // Pretty permalinks 244 $this->set_permalink_structure( '/%postname%/' ); 245 $profile_edit_url = 'http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/edit/'; 246 247 // Output. 248 $this->expectOutputString( $profile_edit_url ); 249 bbp_user_profile_edit_url( $this->keymaster_id ); 250 251 ob_clean(); 252 253 // Ugly permalinks 254 $this->set_permalink_structure(); 255 $profile_edit_url = 'http://' . WP_TESTS_DOMAIN . '/?bbp_user=' . $this->keymaster_id . '&edit=1'; 256 257 // Output. 258 $this->expectOutputString( $profile_edit_url ); 259 bbp_user_profile_edit_url( $this->keymaster_id ); 260 } 261 262 /** 263 * @covers ::bbp_get_user_profile_edit_url 264 */ 265 public function test_bbp_get_user_profile_edit_url() { 266 267 // Pretty permalinks 268 $this->set_permalink_structure( '/%postname%/' ); 269 $profile_edit_url = 'http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/edit/'; 270 271 // String. 272 $this->assertSame( $profile_edit_url, bbp_get_user_profile_edit_url( $this->keymaster_id ) ); 273 274 // Ugly permalinks 275 $this->set_permalink_structure(); 276 $profile_edit_url = 'http://' . WP_TESTS_DOMAIN . '/?bbp_user=' . $this->keymaster_id . '&edit=1'; 277 278 // String. 279 $this->assertSame( $profile_edit_url, bbp_get_user_profile_edit_url( $this->keymaster_id ) ); 280 } 281 282 /** 283 * @covers ::bbp_user_display_role 284 * @covers ::bbp_get_user_display_role 285 */ 286 public function test_bbp_get_user_display_role() { 287 $display_role = 'Keymaster'; 288 289 // String. 290 $this->assertSame( $display_role, bbp_get_user_display_role( $this->keymaster_id ) ); 291 292 // Output. 293 $this->expectOutputString( $display_role ); 294 bbp_user_display_role( $this->keymaster_id ); 295 } 296 297 /** 298 * @covers ::bbp_admin_link 299 * @covers ::bbp_get_admin_link 300 */ 301 public function test_bbp_get_admin_link() { 302 $admin_link = '<a href="http://' . WP_TESTS_DOMAIN . '/wp-admin/">Admin</a>'; 303 304 $user_admin_link = bbp_get_admin_link( $this->keymaster_id ); 305 306 // String. 307 $this->assertSame( $admin_link, $user_admin_link ); 308 309 // Output. 310 $this->expectOutputString( $admin_link ); 311 bbp_admin_link( $this->keymaster_id ); 312 } 313 314 /** 315 * @covers ::bbp_author_ip 316 * @covers ::bbp_get_author_ip 317 */ 318 public function test_bbp_get_author_ip() { 319 $t = $this->factory->topic->create(); 320 321 $author_ip = '<span class="bbp-author-ip">(127.0.0.1)</span>'; 322 323 // String. 324 $this->assertSame( $author_ip, bbp_get_author_ip( $t ) ); 325 326 // Output. 327 $this->expectOutputString( $author_ip ); 328 bbp_author_ip( $t ); 329 } 330 331 /** 332 * @covers ::bbp_author_display_name 333 * @covers ::bbp_get_author_display_name 334 * @todo Implement test_bbp_get_author_display_name(). 335 */ 336 public function test_bbp_get_author_display_name() { 337 // Remove the following lines when you implement this test. 338 $this->markTestIncomplete( 339 'This test has not been implemented yet.' 340 ); 341 } 342 343 /** 344 * @covers ::bbp_author_email 345 * @covers ::bbp_get_author_email 346 * @todo Implement test_bbp_get_author_email(). 347 */ 348 public function test_bbp_get_author_email() { 349 // Remove the following lines when you implement this test. 350 $this->markTestIncomplete( 351 'This test has not been implemented yet.' 352 ); 353 } 354 355 /** 356 * @covers ::bbp_author_url 357 * @covers ::bbp_get_author_url 358 * @todo Implement test_bbp_get_author_url(). 359 */ 360 public function test_bbp_get_author_url() { 361 // Remove the following lines when you implement this test. 362 $this->markTestIncomplete( 363 'This test has not been implemented yet.' 364 ); 365 } 366 367 /** 368 * @covers ::bbp_favorites_permalink 369 */ 370 public function test_bbp_favorites_permalink() { 371 372 // Pretty permalinks 373 $this->set_permalink_structure( '/%postname%/' ); 374 $favorites_url = 'http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/favorites/'; 375 376 // Output. 377 $this->expectOutputString( $favorites_url ); 378 bbp_favorites_permalink( $this->keymaster_id ); 379 380 ob_clean(); 381 382 // Ugly permalinks 383 $this->set_permalink_structure(); 384 $favorites_url = 'http://' . WP_TESTS_DOMAIN . '/?bbp_user=' . $this->keymaster_id . '&bbp_favs=favorites'; 385 386 // Output. 387 $this->expectOutputString( $favorites_url ); 388 bbp_favorites_permalink( $this->keymaster_id ); 389 } 390 391 /** 392 * @covers ::bbp_get_favorites_permalink 393 */ 394 public function test_bbp_get_favorites_permalink() { 395 396 // Pretty permalinks 397 $this->set_permalink_structure( '/%postname%/' ); 398 $favorites_url = 'http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/favorites/'; 399 400 // String. 401 $this->assertSame( $favorites_url, bbp_get_favorites_permalink( $this->keymaster_id ) ); 402 403 // Ugly permalinks 404 $this->set_permalink_structure(); 405 $favorites_url = 'http://' . WP_TESTS_DOMAIN . '/?bbp_user=' . $this->keymaster_id . '&bbp_favs=favorites'; 406 407 // String. 408 $this->assertSame( $favorites_url, bbp_get_favorites_permalink( $this->keymaster_id ) ); 409 } 410 411 /** 412 * @covers ::bbp_user_favorites_link 413 * @covers ::bbp_get_user_favorites_link 414 * @todo Implement test_bbp_get_user_favorites_link(). 415 */ 416 public function test_bbp_get_user_favorites_link() { 417 // Remove the following lines when you implement this test. 418 $this->markTestIncomplete( 419 'This test has not been implemented yet.' 420 ); 421 } 422 423 /** 424 * @covers ::bbp_subscriptions_permalink 425 */ 426 public function test_bbp_subscriptions_permalink() { 427 428 // Pretty permalinks 429 $this->set_permalink_structure( '/%postname%/' ); 430 $subscriptions_url = 'http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/subscriptions/'; 431 432 // Output. 433 $this->expectOutputString( $subscriptions_url ); 434 bbp_subscriptions_permalink( $this->keymaster_id ); 435 436 ob_clean(); 437 438 // Ugly permalinks 439 $this->set_permalink_structure(); 440 $subscriptions_url = 'http://' . WP_TESTS_DOMAIN . '/?bbp_user=' . $this->keymaster_id . '&bbp_subs=subscriptions'; 441 442 // Output. 443 $this->expectOutputString( $subscriptions_url ); 444 bbp_subscriptions_permalink( $this->keymaster_id ); 445 } 446 447 /** 448 * @covers ::bbp_get_subscriptions_permalink 449 */ 450 public function test_bbp_get_subscriptions_permalink() { 451 452 // Pretty permalinks 453 $this->set_permalink_structure( '/%postname%/' ); 454 $subscriptions_url = 'http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/subscriptions/'; 455 456 // String. 457 $this->assertSame( $subscriptions_url, bbp_get_subscriptions_permalink( $this->keymaster_id ) ); 458 459 // Ugly permalinks 460 $this->set_permalink_structure(); 461 $subscriptions_url = 'http://' . WP_TESTS_DOMAIN . '/?bbp_user=' . $this->keymaster_id . '&bbp_subs=subscriptions'; 462 463 // String. 464 $this->assertSame( $subscriptions_url, bbp_get_subscriptions_permalink( $this->keymaster_id ) ); 465 } 466 467 /** 468 * @covers ::bbp_user_subscribe_link 469 * @covers ::bbp_get_user_subscribe_link 470 * @todo Implement test_bbp_get_user_subscribe_link(). 471 */ 472 public function test_bbp_get_user_subscribe_link() { 473 // Remove the following lines when you implement this test. 474 $this->markTestIncomplete( 475 'This test has not been implemented yet.' 476 ); 477 } 478 479 /** 480 * @covers ::bbp_notice_edit_user_success 481 * @todo Implement test_bbp_notice_edit_user_success(). 482 */ 483 public function test_bbp_notice_edit_user_success() { 484 // Remove the following lines when you implement this test. 485 $this->markTestIncomplete( 486 'This test has not been implemented yet.' 487 ); 488 } 489 490 /** 491 * @covers ::bbp_notice_edit_user_pending_email 492 * @todo Implement test_bbp_notice_edit_user_pending_email(). 493 */ 494 public function test_bbp_notice_edit_user_pending_email() { 495 // Remove the following lines when you implement this test. 496 $this->markTestIncomplete( 497 'This test has not been implemented yet.' 498 ); 499 } 500 501 /** 502 * @covers ::bbp_notice_edit_user_is_super_admin 503 * @todo Implement test_bbp_notice_edit_user_is_super_admin(). 504 */ 505 public function test_bbp_notice_edit_user_is_super_admin() { 506 // Remove the following lines when you implement this test. 507 $this->markTestIncomplete( 508 'This test has not been implemented yet.' 509 ); 510 } 511 512 /** 513 * @covers ::bbp_edit_user_display_name 514 * @todo Implement test_bbp_edit_user_display_name(). 515 */ 516 public function test_bbp_edit_user_display_name() { 517 // Remove the following lines when you implement this test. 518 $this->markTestIncomplete( 519 'This test has not been implemented yet.' 520 ); 521 } 522 523 /** 524 * @covers ::bbp_edit_user_blog_role 525 * @todo Implement test_bbp_edit_user_blog_role(). 526 */ 527 public function test_bbp_edit_user_blog_role() { 528 // Remove the following lines when you implement this test. 529 $this->markTestIncomplete( 530 'This test has not been implemented yet.' 531 ); 532 } 533 534 /** 535 * @covers ::bbp_edit_user_forums_role 536 * @todo Implement test_bbp_edit_user_forums_role(). 537 */ 538 public function test_bbp_edit_user_forums_role() { 539 // Remove the following lines when you implement this test. 540 $this->markTestIncomplete( 541 'This test has not been implemented yet.' 542 ); 543 } 544 545 /** 546 * @covers ::bbp_edit_user_contact_methods 547 * @todo Implement test_bbp_edit_user_contact_methods(). 548 */ 549 public function test_bbp_edit_user_contact_methods() { 550 // Remove the following lines when you implement this test. 551 $this->markTestIncomplete( 552 'This test has not been implemented yet.' 553 ); 554 } 555 556 /** 557 * @covers ::bbp_user_topics_created_url 558 */ 559 public function test_bbp_user_topics_created_url() { 560 561 // Pretty permalinks 562 $this->set_permalink_structure( '/%postname%/' ); 563 $topics_created_url = 'http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/topics/'; 564 565 // Output. 566 $this->expectOutputString( $topics_created_url ); 567 bbp_user_topics_created_url( $this->keymaster_id ); 568 569 ob_clean(); 570 571 // Ugly permalinks 572 $this->set_permalink_structure(); 573 $topics_created_url = 'http://' . WP_TESTS_DOMAIN . '/?bbp_user=' . $this->keymaster_id . '&bbp_tops=1'; 574 575 // Output. 576 $this->expectOutputString( $topics_created_url ); 577 bbp_user_topics_created_url( $this->keymaster_id ); 578 } 579 580 /** 581 * @covers ::bbp_get_user_topics_created_url 582 */ 583 public function test_bbp_get_user_topics_created_url() { 584 585 // Pretty permalinks 586 $this->set_permalink_structure( '/%postname%/' ); 587 $topics_created_url = 'http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/topics/'; 588 589 // String. 590 $this->assertSame( $topics_created_url, bbp_get_user_topics_created_url( $this->keymaster_id ) ); 591 592 // Ugly permalinks 593 $this->set_permalink_structure(); 594 $topics_created_url = 'http://' . WP_TESTS_DOMAIN . '/?bbp_user=' . $this->keymaster_id . '&bbp_tops=1'; 595 596 // String. 597 $this->assertSame( $topics_created_url, bbp_get_user_topics_created_url( $this->keymaster_id ) ); 598 } 599 600 /** 601 * @covers ::bbp_user_replies_created_url 602 */ 603 public function test_bbp_user_replies_created_url() { 604 605 // Pretty permalinks 606 $this->set_permalink_structure( '/%postname%/' ); 607 $replies_created_url = 'http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/replies/'; 608 609 // Output. 610 $this->expectOutputString( $replies_created_url ); 611 bbp_user_replies_created_url( $this->keymaster_id ); 612 613 ob_clean(); 614 615 // Ugly permalinks 616 $this->set_permalink_structure(); 617 $replies_created_url = 'http://' . WP_TESTS_DOMAIN . '/?bbp_user='. $this->keymaster_id . '&bbp_reps=1'; 618 619 // Output. 620 $this->expectOutputString( $replies_created_url ); 621 bbp_user_replies_created_url( $this->keymaster_id ); 622 } 623 624 /** 625 * @covers ::bbp_get_user_replies_created_url 626 */ 627 public function test_bbp_get_user_replies_created_url() { 628 629 // Pretty permalinks 630 $this->set_permalink_structure( '/%postname%/' ); 631 $replies_created_url = 'http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/replies/'; 632 633 // String. 634 $this->assertSame( $replies_created_url, bbp_get_user_replies_created_url( $this->keymaster_id ) ); 635 636 // Ugly permalinks 637 $this->set_permalink_structure(); 638 $replies_created_url = 'http://' . WP_TESTS_DOMAIN . '/?bbp_user='. $this->keymaster_id . '&bbp_reps=1'; 639 640 // String. 641 $this->assertSame( $replies_created_url, bbp_get_user_replies_created_url( $this->keymaster_id ) ); 642 } 643 644 /** 645 * @covers ::bbp_login_notices 646 * @todo Implement test_bbp_login_notices(). 647 */ 648 public function test_bbp_login_notices() { 649 // Remove the following lines when you implement this test. 650 $this->markTestIncomplete( 651 'This test has not been implemented yet.' 652 ); 653 } 654 655 /** 656 * @covers ::bbp_logged_in_redirect 657 * @todo Implement test_bbp_logged_in_redirect(). 658 */ 659 public function test_bbp_logged_in_redirect() { 660 // Remove the following lines when you implement this test. 661 $this->markTestIncomplete( 662 'This test has not been implemented yet.' 663 ); 664 } 665 666 /** 667 * @covers ::bbp_user_login_fields 668 * @todo Implement test_bbp_user_login_fields(). 669 */ 670 public function test_bbp_user_login_fields() { 671 // Remove the following lines when you implement this test. 672 $this->markTestIncomplete( 673 'This test has not been implemented yet.' 674 ); 675 } 676 677 /** 678 * @covers ::bbp_user_register_fields 679 * @todo Implement test_bbp_user_register_fields(). 680 */ 681 public function test_bbp_user_register_fields() { 682 // Remove the following lines when you implement this test. 683 $this->markTestIncomplete( 684 'This test has not been implemented yet.' 685 ); 686 } 687 688 /** 689 * @covers ::bbp_user_lost_pass_fields 690 * @todo Implement test_bbp_user_lost_pass_fields(). 691 */ 692 public function test_bbp_user_lost_pass_fields() { 693 // Remove the following lines when you implement this test. 694 $this->markTestIncomplete( 695 'This test has not been implemented yet.' 696 ); 697 } 698 699 /** 700 * @covers ::bbp_author_link 701 * @covers ::bbp_get_author_link 702 */ 703 public function test_bbp_get_author_link() { 704 $t = $this->factory->topic->create(); 705 706 $display_name = $this->keymaster_userdata->display_name; 707 $current_user = get_current_user_id(); 708 $size = 80; 709 $wp_avatar = get_avatar( $current_user, $size ); 710 711 // Pretty permalinks 712 $this->set_permalink_structure( '/%postname%/' ); 713 $author_link = '<a href="http://' . WP_TESTS_DOMAIN . '/forums/users/' . $this->keymaster_userdata->user_nicename . '/" title="View ' . $display_name . ''s profile" class="bbp-author-link"><span class="bbp-author-avatar">' . $wp_avatar . 714 '</span> <span class="bbp-author-name">' . $display_name . '</span></a>'; 715 716 // String. 717 $this->assertSame( $author_link, bbp_get_author_link( $t ) ); 718 719 // Output. 720 $this->expectOutputString( $author_link ); 721 bbp_author_link( $t ); 722 723 ob_clean(); 724 725 // Ugly permalinks 726 $this->set_permalink_structure(); 727 $author_link = '<a href="http://' . WP_TESTS_DOMAIN . '/?bbp_user=' . $this->keymaster_id . '" title="View ' . $display_name . 728 ''s profile" class="bbp-author-link"><span class="bbp-author-avatar">' . $wp_avatar . 729 '</span> <span class="bbp-author-name">' . $display_name . '</span></a>'; 730 731 // String. 732 $this->assertSame( $author_link, bbp_get_author_link( $t ) ); 733 734 // Output. 735 $this->expectOutputString( $author_link ); 736 bbp_author_link( $t ); 737 } 738 739 /** 740 * @covers ::bbp_user_can_view_forum 741 * @todo Implement test_bbp_user_can_view_forum(). 742 */ 743 public function test_bbp_user_can_view_forum() { 744 // Remove the following lines when you implement this test. 745 $this->markTestIncomplete( 746 'This test has not been implemented yet.' 747 ); 748 } 749 750 /** 751 * @covers ::bbp_current_user_can_publish_forums 752 * @todo Implement test_bbp_current_user_can_publish_forums(). 753 */ 754 public function test_bbp_current_user_can_publish_forums() { 755 // Remove the following lines when you implement this test. 756 $this->markTestIncomplete( 757 'This test has not been implemented yet.' 758 ); 759 } 760 761 /** 762 * @covers ::bbp_current_user_can_publish_topics 763 * @todo Implement test_bbp_current_user_can_publish_topics(). 764 */ 765 public function test_bbp_current_user_can_publish_topics() { 766 // Remove the following lines when you implement this test. 767 $this->markTestIncomplete( 768 'This test has not been implemented yet.' 769 ); 770 } 771 772 /** 773 * @covers ::bbp_current_user_can_publish_replies 774 * @todo Implement test_bbp_current_user_can_publish_replies(). 775 */ 776 public function test_bbp_current_user_can_publish_replies() { 777 // Remove the following lines when you implement this test. 778 $this->markTestIncomplete( 779 'This test has not been implemented yet.' 780 ); 781 } 782 783 /** 784 * @covers ::bbp_get_forums_for_current_user 785 * @todo Implement test_bbp_get_forums_for_current_user(). 786 */ 787 public function test_bbp_get_forums_for_current_user() { 788 // Remove the following lines when you implement this test. 789 $this->markTestIncomplete( 790 'This test has not been implemented yet.' 791 ); 792 } 793 794 /** 795 * @covers ::bbp_current_user_can_access_create_forum_form 796 * @todo Implement test_bbp_current_user_can_access_create_forum_form(). 797 */ 798 public function test_bbp_current_user_can_access_create_forum_form() { 799 // Remove the following lines when you implement this test. 800 $this->markTestIncomplete( 801 'This test has not been implemented yet.' 802 ); 803 } 804 805 /** 806 * @covers ::bbp_current_user_can_access_create_topic_form 807 * @todo Implement test_bbp_current_user_can_access_create_topic_form(). 808 */ 809 public function test_bbp_current_user_can_access_create_topic_form() { 810 // Remove the following lines when you implement this test. 811 $this->markTestIncomplete( 812 'This test has not been implemented yet.' 813 ); 814 } 815 816 /** 817 * @covers ::bbp_current_user_can_access_create_reply_form 818 * @todo Implement test_bbp_current_user_can_access_create_reply_form(). 819 */ 820 public function test_bbp_current_user_can_access_create_reply_form() { 821 // Remove the following lines when you implement this test. 822 $this->markTestIncomplete( 823 'This test has not been implemented yet.' 824 ); 825 } 826 827 /** 828 * @covers ::bbp_current_user_can_access_anonymous_user_form 829 * @todo Implement test_bbp_current_user_can_access_anonymous_user_form(). 830 */ 831 public function test_bbp_current_user_can_access_anonymous_user_form() { 832 // Remove the following lines when you implement this test. 833 $this->markTestIncomplete( 834 'This test has not been implemented yet.' 835 ); 836 } 837 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Mon Dec 30 01:00:53 2024 | Cross-referenced by PHPXref 0.7.1 |