You are here

protected function GTMBaseTestCase::verifyNoScriptSnippet in GoogleTagManager 7

Same name and namespace in other branches
  1. 7.2 tests/google_tag.base.test \GTMBaseTestCase::verifyNoScriptSnippet()

Verify the snippet file contents.

File

tests/google_tag.base.test, line 96

Class

GTMBaseTestCase
Tests the Google Tag Manager.

Code

protected function verifyNoScriptSnippet($contents, $variables) {
  $status = strpos($contents, "id={$variables->google_tag_container_id}") !== FALSE;
  $message = 'Found in noscript snippet file: container_id';
  $this
    ->assert($status, $message, $this->group);
  $status = strpos($contents, "gtm_preview={$variables->google_tag_environment_id}") !== FALSE;
  $message = 'Found in noscript snippet file: environment_id';
  $this
    ->assert($status, $message, $this->group);
  $status = strpos($contents, "gtm_auth={$variables->google_tag_environment_token}") !== FALSE;
  $message = 'Found in noscript snippet file: environment_token';
  $this
    ->assert($status, $message, $this->group);
}