[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/tests/phpunit/testcases/core/functions/ -> bpCoreGetDirectoryPageId.php (source)

   1  <?php
   2  
   3  /**
   4   * @group core
   5   * @group BP7025
   6   * @covers ::bp_core_get_directory_page_id
   7   */
   8  class BP_Tests_Core_BpCoreGetDirectoryPageId extends BP_UnitTestCase {
   9  	public function test_should_fall_back_on_current_component() {
  10          $this->go_to( bp_get_activity_directory_permalink() );
  11  
  12          $found = bp_core_get_directory_page_id();
  13  
  14          $pages = bp_core_get_directory_page_ids();
  15          $this->assertSame( $pages['activity'], $found );
  16      }
  17  
  18  	public function test_should_accept_component_override() {
  19          $this->go_to( bp_get_activity_directory_permalink() );
  20  
  21          $found = bp_core_get_directory_page_id( 'members' );
  22  
  23          $pages = bp_core_get_directory_page_ids();
  24          $this->assertSame( $pages['members'], $found );
  25      }
  26  
  27      public function test_should_return_false_for_invalid_component() {
  28          $found = bp_core_get_directory_page_id( 'foo' );
  29  
  30          $pages = bp_core_get_directory_page_ids();
  31          $this->assertFalse( $found );
  32      }
  33  }


Generated: Mon Nov 25 01:00:57 2024 Cross-referenced by PHPXref 0.7.1