You are here

public function AuthcacheEnumCombTestCase::testCombineKOffLimit in Authenticated User Page Caching (Authcache) 7.2

Test calculation of k-combinations where k is out of range.

File

modules/authcache_enum/lib/Drupal/authcache_enum/Tests/AuthcacheEnumCombTestCase.php, line 73
Defines a test case covering _authcache_enum_comb.

Class

AuthcacheEnumCombTestCase
Unit tests for _authcache_enum_comb.

Namespace

Drupal\authcache_enum\Tests

Code

public function testCombineKOffLimit() {
  $set = array(
    'a',
    'b',
    'c',
    'd',
  );
  $expect = array(
    array(
      'a',
    ),
    array(
      'b',
    ),
    array(
      'c',
    ),
    array(
      'd',
    ),
  );
  $result = _authcache_enum_comb_k($set, 0);
  $this
    ->assertEqual($expect, $result);
  $expect = array(
    array(
      'a',
      'b',
      'c',
      'd',
    ),
  );
  $result = _authcache_enum_comb_k($set, 4);
  $this
    ->assertEqual($expect, $result);
}