You are here

protected function GTMTestBase::submitContainers in GoogleTagManager 8

Add containers through user interface.

1 call to GTMTestBase::submitContainers()
GTMTestBase::testModule in tests/src/Functional/GTMTestBase.php
Test the module.

File

tests/src/Functional/GTMTestBase.php, line 199

Class

GTMTestBase
Tests the Google Tag Manager.

Namespace

Drupal\Tests\google_tag\Functional

Code

protected function submitContainers() {
  $this
    ->drupalLogin($this->adminUser);
  foreach ($this->variables as $key => $variables) {
    $edit = (array) $variables;
    $this
      ->drupalPostForm('/admin/config/system/google-tag/add', $edit, 'Save');
    $text = 'Created @count snippet files for %container container based on configuration.';
    $args = [
      '@count' => 3,
      '%container' => $variables->label,
    ];
    $text = t($text, $args);
    $this
      ->assertSession()
      ->responseContains($text);
    $text = 'Created @count snippet files for @container container based on configuration.';
    $args = [
      '@count' => 3,
      '@container' => $variables->label,
    ];
    $text = t($text, $args);
    $this
      ->assertSession()
      ->pageTextContains($text);
  }
}