You are here

function CDNOriginPullTestCase::assertMapping in CDN 7.2

Assert a CDN 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.

$domains_reference: The reference the domains (as returned by cdn_get_domains()) will be compared to.

1 call to CDNOriginPullTestCase::assertMapping()
CDNOriginPullTestCase::testMapping in tests/cdn.test

File

tests/cdn.test, line 237
Test CDN.

Class

CDNOriginPullTestCase

Code

function assertMapping($mapping, $parsed_reference, $domains_reference) {
  if ($mapping !== FALSE) {
    $this
      ->variableSet(CDN_BASIC_MAPPING_VARIABLE, $mapping);
  }
  $this
    ->assertEqual($parsed_reference, _cdn_basic_parse_raw_mapping(cdn_basic_get_mapping()), 'CDN mapping parsed correctly.');
  $domains = cdn_get_domains();
  sort($domains);
  $this
    ->assertEqual($domains_reference, $domains, 'CDN domains parsed correctly.');
}