You are here

function CDNOriginPullFarFutureTestCase::assertUFIMapping in CDN 7.2

Assert a UFI mapping (and optionally set a mapping).

Parameters

$mapping: The mapping to set; if FALSE, no new mapping will be set.

$parsed_reference: The reference the parsed mapping will be compared to.

$message:

1 call to CDNOriginPullFarFutureTestCase::assertUFIMapping()
CDNOriginPullFarFutureTestCase::testUFIMapping in tests/cdn.test

File

tests/cdn.test, line 368
Test CDN.

Class

CDNOriginPullFarFutureTestCase

Code

function assertUFIMapping($mapping, $parsed_reference, $message = NULL) {
  if (is_null($message)) {
    $message = 'UFI mapping parsed correctly.';
  }
  if ($mapping !== FALSE) {
    $this
      ->variableSet(CDN_BASIC_FARFUTURE_UNIQUE_IDENTIFIER_MAPPING_VARIABLE, $mapping);
  }
  $parsed = _cdn_basic_farfuture_parse_raw_mapping(variable_get(CDN_BASIC_FARFUTURE_UNIQUE_IDENTIFIER_MAPPING_VARIABLE, CDN_BASIC_FARFUTURE_UNIQUE_IDENTIFIER_MAPPING_DEFAULT));
  $this
    ->assertEqual($parsed_reference, $parsed, $message);
}