You are here

protected function GTMNoRealmTestCase::checkPageResponse in GoogleTagManager 7

Same name and namespace in other branches
  1. 7.2 tests/google_tag.norealm.test \GTMNoRealmTestCase::checkPageResponse()

Inspect the page response.

Overrides GTMBaseTestCase::checkPageResponse

File

tests/google_tag.norealm.test, line 59

Class

GTMNoRealmTestCase
Tests the Google Tag Manager for a site with no realms.

Code

protected function checkPageResponse() {
  parent::checkPageResponse();
  $this
    ->drupalGet('');
  $realm_name = $key_name = '';
  foreach ($this->types as $type) {
    $uri = "{$this->basePath}/google_tag/{$realm_name}google_tag.{$key_name}{$type}.js";
    if ($wrapper = file_stream_wrapper_get_instance_by_uri($uri)) {
      $realpath = $wrapper
        ->getExternalUrl($uri);
      $function = "verify{$type}Tag";
      $this
        ->{$function}($realpath, $this->variables);
    }
    else {

      // @todo
    }
  }
}