You are here

public function GTMBaseTestCase::testModule in GoogleTagManager 7.2

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

Test the module.

File

tests/google_tag.base.test, line 51

Class

GTMBaseTestCase
Tests the Google Tag Manager.

Code

public function testModule() {
  if (get_class($this) == 'GTMBaseTestCase') {
    $this
      ->assertTrue(TRUE, t('No assertions on base test class'), $this->group);
    return;
  }
  try {
    $this
      ->modifySettings();

    // Create containers in code.
    $this
      ->createData();
    $this
      ->saveContainers();
    $this
      ->checkSnippetFiles();
    $this
      ->checkPageResponse();

    // Delete containers.
    $this
      ->deleteContainers();

    // Create containers in user interface.
    $this
      ->submitContainers();
    $this
      ->checkSnippetFiles();
    $this
      ->checkPageResponse();
  } catch (Exception $e) {
    $this
      ->assertTrue(TRUE, t('Inside CATCH block'), $this->group);
    watchdog_exception('gtm_test', $e);
  } finally {
    $this
      ->assertTrue(TRUE, t('Inside FINALLY block'), $this->group);
  }
}