You are here

function GoogleAnalyticsBasicTest::testGoogleAnalytics in Google Analytics 6

Same name and namespace in other branches
  1. 6.2 tests/googleanalytics_basic.test \GoogleAnalyticsBasicTest::testGoogleAnalytics()

File

tests/googleanalytics_basic.test, line 27
Test file for Google Analytics module.

Class

GoogleAnalyticsBasicTest
@file Test file for Google Analytics module.

Code

function testGoogleAnalytics() {

  // Check for setting page's presence.
  $this
    ->drupalGet('admin/settings/googleanalytics');
  $this
    ->assertRaw(t('Google Analytics account number'), '[testGoogleAnalytics]: Settings page displayed.');

  // Check for account code validation.
  $edit['googleanalytics_account'] = $this
    ->randomName(2);
  $this
    ->drupalPost('admin/settings/googleanalytics', $edit, 'Save configuration');
  $this
    ->assertRaw(t('A valid Google Analytics account number is case sensitive and formated like UA-xxxxxx-x.'), '[testGoogleAnalytics]: Account number validated.');
}