- Timestamp:
- 06/25/2023 05:18:41 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/core/nav/bpCoreRemoveNavItem.php
r11256 r13507 6 6 */ 7 7 class BP_Tests_Core_Nav_BpCoreRemoveNavItem extends BP_UnitTestCase { 8 /**9 * @expectedIncorrectUsage bp_nav10 */11 public function test_should_remove_subnav_items() {12 $bp = buddypress();13 14 $_bp_nav = $bp->bp_nav;15 $_bp_options_nav = $bp->bp_options_nav;16 17 bp_core_new_nav_item( array(18 'name' => 'Foo',19 'slug' => 'foo',20 'screen_function' => 'foo',21 ) );22 23 bp_core_new_subnav_item( array(24 'name' => 'Bar',25 'slug' => 'bar',26 'parent_slug' => 'foo',27 'parent_url' => 'foo',28 'screen_function' => 'bar',29 ) );30 31 $this->assertTrue( isset( $bp->bp_nav['foo'] ) );32 $this->assertTrue( isset( $bp->bp_options_nav['foo'] ) );33 $this->assertTrue( isset( $bp->bp_options_nav['foo']['bar'] ) );34 35 bp_core_remove_nav_item( 'foo' );36 37 $this->assertFalse( isset( $bp->bp_options_nav['foo']['bar'] ) );38 39 $bp->bp_nav = $_bp_nav;40 $bp->bp_options_nav = $_bp_options_nav;41 }42 43 /**44 * @expectedIncorrectUsage bp_nav45 */46 public function test_should_remove_nav_item() {47 $bp = buddypress();48 49 $_bp_nav = $bp->bp_nav;50 $_bp_options_nav = $bp->bp_options_nav;51 52 bp_core_new_nav_item( array(53 'name' => 'Foo',54 'slug' => 'foo',55 'screen_function' => 'foo',56 ) );57 58 $this->assertTrue( isset( $bp->bp_nav['foo'] ) );59 60 bp_core_remove_nav_item( 'foo' );61 62 $this->assertFalse( isset( $bp->bp_nav['foo'] ) );63 64 $bp->bp_nav = $_bp_nav;65 $bp->bp_options_nav = $_bp_options_nav;66 }67 68 8 /** 69 9 * @ticket BP7203
Note: See TracChangeset
for help on using the changeset viewer.