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