Changeset 11747 for trunk/tests/phpunit/testcases/members/functions.php
- Timestamp:
- 11/16/2017 08:00:41 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/members/functions.php
r11737 r11747 638 638 $wpdb->suppress_errors( $suppress ); 639 639 } 640 641 /** 642 * @ticket BP7461 643 * 644 * Test function before and after adding custom illegal names from WordPress. 645 */ 646 public function test_bp_core_get_illegal_names() { 647 648 // Making sure BP custom illegals are in the array. 649 $this->assertTrue( in_array( 'profile', bp_core_get_illegal_names(), true ) ); 650 $this->assertTrue( in_array( 'forums', bp_core_get_illegal_names(), true ) ); 651 652 add_filter( 'illegal_user_logins', array( $this, '_illegal_user_logins' ) ); 653 654 // Testing fake custom illegal names. 655 $this->assertTrue( in_array( 'testuser', bp_core_get_illegal_names(), true ) ); 656 $this->assertTrue( in_array( 'admins', bp_core_get_illegal_names(), true ) ); 657 $this->assertFalse( in_array( 'buddypresss', bp_core_get_illegal_names(), true ) ); 658 659 // Making sure BP custom illegals are in the array after including the custom ones. 660 $this->assertTrue( in_array( 'profile', bp_core_get_illegal_names(), true ) ); 661 $this->assertTrue( in_array( 'forums', bp_core_get_illegal_names(), true ) ); 662 663 remove_filter( 'illegal_user_logins', array( $this, '_illegal_user_logins' ) ); 664 } 665 666 public function _illegal_user_logins() { 667 return array( 668 'testuser', 669 'admins', 670 'buddypress', 671 ); 672 } 640 673 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)