[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/tests/phpunit/testcases/groups/functions/ -> groupsTotalGroupsForUser.php (source)

   1  <?php
   2  
   3  /**
   4   * @group groups
   5   * @covers ::groups_total_groups_for_user
   6   */
   7  class BP_Tests_Groups_Functions_GroupsTotalGroupsForUser extends BP_UnitTestCase {
   8      /**
   9       * @ticket BP6813
  10       */
  11  	public function test_should_return_integer() {
  12          $this->assertInternalType( 'int', groups_total_groups_for_user( 123 ) );
  13      }
  14  
  15      /**
  16       * @ticket BP6813
  17       */
  18      public function test_should_return_integer_when_fetching_from_cache() {
  19          /*
  20           * Put a string in the cache.
  21           * In-memory cache will respect type, but persistent caching engines return all scalars as strings.
  22           */
  23          wp_cache_set( 'bp_total_groups_for_user_123', '321', 'bp' );
  24  
  25          $this->assertInternalType( 'int', groups_total_groups_for_user( 123 ) );
  26      }
  27  }


Generated: Thu Apr 25 01:01:12 2024 Cross-referenced by PHPXref 0.7.1