Changeset 10745 for trunk/tests/phpunit/testcases/core/nav/bpCoreMaybeHookNewSubnavScreenFunction.php
- Timestamp:
- 05/12/2016 05:19:06 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/core/nav/bpCoreMaybeHookNewSubnavScreenFunction.php
r9988 r10745 83 83 $old_default_component = buddypress()->default_component; 84 84 buddypress()->default_component = 'foo'; 85 buddypress()->bp_nav = array( 86 'foo' => array( 87 'show_for_displayed_user' => true, 88 ), 89 ); 85 86 bp_core_new_nav_item( array( 87 'slug' => 'foo', 88 'name' => 'Foo', 89 'screen_function' => 'foo', 90 'default_subnav_item' => 'bar', 91 ) ); 90 92 91 93 $subnav_item = array( … … 95 97 // Just test relevant info 96 98 $found = bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ); 97 $this->assertSame( 'failure', $found['status'] );98 $this->assertSame( bp_core_get_user_domain( $u2 ), $found['redirect_args']['root'] );99 99 100 100 // Clean up … … 102 102 buddypress()->default_component = $old_default_component; 103 103 buddypress()->bp_nav = $old_bp_nav; 104 105 $this->assertSame( 'failure', $found['status'] ); 106 $this->assertSame( bp_core_get_user_domain( $u2 ), $found['redirect_args']['root'] ); 104 107 } 105 108 … … 115 118 $old_default_component = buddypress()->default_component; 116 119 buddypress()->default_component = 'foo'; 117 buddypress()->bp_nav = array( 118 'foo' => array( 119 'show_for_displayed_user' => false, 120 ), 121 ); 120 121 bp_core_new_nav_item( array( 122 'slug' => 'foo', 123 'name' => 'Foo', 124 'screen_function' => 'foo', 125 'default_subnav_item' => 'bar', 126 'show_for_displayed_user' => false, 127 ) ); 122 128 123 129 $subnav_item = array( … … 127 133 // Just test relevant info 128 134 $found = bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ); 129 $this->assertSame( 'failure', $found['status'] );130 $this->assertSame( bp_core_get_user_domain( $u2 ) . bp_get_activity_slug() . '/', $found['redirect_args']['root'] );131 135 132 136 // Clean up … … 134 138 buddypress()->default_component = $old_default_component; 135 139 buddypress()->bp_nav = $old_bp_nav; 140 141 $this->assertSame( 'failure', $found['status'] ); 142 $this->assertSame( bp_core_get_user_domain( $u2 ) . bp_get_activity_slug() . '/', $found['redirect_args']['root'] ); 136 143 } 137 144
Note: See TracChangeset
for help on using the changeset viewer.