You are here

protected function ApiProductAccessTest::calculateRidCombinations in Apigee Edge 8

Calculates all possible combinations from role ids.

Parameters

array $rids: Array of role ids.

Return value

array All possible combinations calculated from rids.

4 calls to ApiProductAccessTest::calculateRidCombinations()
ApiProductAccessTest::setUp in tests/src/FunctionalJavascript/ApiProductAccessTest.php
ApiProductRoleBasedAccessAnonymousAuthenticatedTest::setUp in modules/apigee_edge_apiproduct_rbac/tests/src/FunctionalJavascript/ApiProductRoleBasedAccessAnonymousAuthenticatedTest.php
ApiProductRoleBasedAccessAnonymousInternalTest::setUp in modules/apigee_edge_apiproduct_rbac/tests/src/FunctionalJavascript/ApiProductRoleBasedAccessAnonymousInternalTest.php
ApiProductRoleBasedAccessAuthenticatedInternalTest::setUp in modules/apigee_edge_apiproduct_rbac/tests/src/FunctionalJavascript/ApiProductRoleBasedAccessAuthenticatedInternalTest.php

File

tests/src/FunctionalJavascript/ApiProductAccessTest.php, line 374

Class

ApiProductAccessTest
Validates built-in access control on API products.

Namespace

Drupal\Tests\apigee_edge\FunctionalJavascript

Code

protected function calculateRidCombinations(array $rids) : array {
  $ridCombinations = [
    [],
  ];
  foreach ($rids as $rid) {
    foreach ($ridCombinations as $ridCombination) {
      array_push($ridCombinations, array_merge([
        $rid,
      ], $ridCombination));
    }
  }
  return $ridCombinations;
}