protected function GTMBaseTestCase::verifyNoScriptSnippet in GoogleTagManager 7.2
Same name and namespace in other branches
- 7 tests/google_tag.base.test \GTMBaseTestCase::verifyNoScriptSnippet()
Verify the snippet file contents.
File
- tests/
google_tag.base.test, line 214
Class
- GTMBaseTestCase
- Tests the Google Tag Manager.
Code
protected function verifyNoScriptSnippet($contents, $variables) {
$status = strpos($contents, "id={$variables->container_id}") !== FALSE;
$message = 'Found in noscript snippet file: container_id';
$this
->assert($status, $message, $this->group);
$status = strpos($contents, "gtm_preview={$variables->environment_id}") !== FALSE;
$message = 'Found in noscript snippet file: environment_id';
$this
->assert($status, $message, $this->group);
$status = strpos($contents, "gtm_auth={$variables->environment_token}") !== FALSE;
$message = 'Found in noscript snippet file: environment_token';
$this
->assert($status, $message, $this->group);
}