You are here

function GoogleAnalyticsBasicTest::testGoogleAnalyticsConfiguration in Google Analytics 7

Same name and namespace in other branches
  1. 6.4 googleanalytics.test \GoogleAnalyticsBasicTest::testGoogleAnalyticsConfiguration()
  2. 6.3 googleanalytics.test \GoogleAnalyticsBasicTest::testGoogleAnalyticsConfiguration()
  3. 7.2 googleanalytics.test \GoogleAnalyticsBasicTest::testGoogleAnalyticsConfiguration()

File

./googleanalytics.test, line 30
Test file for Google Analytics module.

Class

GoogleAnalyticsBasicTest
@file Test file for Google Analytics module.

Code

function testGoogleAnalyticsConfiguration() {

  // Check for setting page's presence.
  $this
    ->drupalGet('admin/config/system/googleanalytics');
  $this
    ->assertRaw(t('Web Property ID'), '[testGoogleAnalyticsConfiguration]: Settings page displayed.');

  // Check for account code validation.
  $edit['googleanalytics_account'] = $this
    ->randomName(2);
  $this
    ->drupalPost('admin/config/system/googleanalytics', $edit, t('Save configuration'));
  $this
    ->assertRaw(t('A valid Google Analytics Web Property ID is case sensitive and formatted like UA-xxxxxxx-yy.'), '[testGoogleAnalyticsConfiguration]: Invalid Web Property ID number validated.');
}