You are here

function OgTestCase::assertKeysExist in Organic groups 6.2

Same name and namespace in other branches
  1. 6 tests/og_testcase.php \OgTestCase::assertKeysExist()

Assert keys are in an array.

Parameters

$keys: An array of keys that needs to be checked.

$array: The array that has the keys.

Return value

True if all keys exist.

1 call to OgTestCase::assertKeysExist()
OgTestCase::_addOgContent in tests/og_testcase.php
Helper function - create a group content.

File

tests/og_testcase.php, line 111
Common functions for all the organic groups tests.

Class

OgTestCase
@file Common functions for all the organic groups tests.

Code

function assertKeysExist($keys, $array) {
  foreach ($keys as $key) {
    if (!array_key_exists($key, $array)) {
      return FALSE;
    }
  }
  return TRUE;
}