You are here

public function GAPushUnitTestCase::setUp in GA Push 8

Same name and namespace in other branches
  1. 7 test/ga_push.test \GAPushUnitTestCase::setUp()

File

test/ga_push.test, line 31
Test case for testing the GA Push module.

Class

GAPushUnitTestCase
Functional tests for the GA Push module.

Code

public function setUp() {
  parent::setUp('ga_push', 'googleanalytics');

  // $ua_code = 'UA-123456-1';
  // variable_set('googleanalytics_account', $ua_code);.
  // Get defined vars:
  module_load_include('module', 'ga_push');

  // Common pushes:
  $this->pushes = [];

  // Events:
  $this->pushes[GA_PUSH_TYPE_EVENT]['calv'] = [
    'eventCategory' => 'Videos',
    'eventAction' => 'Play',
    'eventLabel' => 'Gone With the Wind',
    'eventValue' => 1,
    'nonInteraction' => FALSE,
  ];
  $this->pushes[GA_PUSH_TYPE_EVENT]['calvn'] = [
    'eventCategory' => 'Videos',
    'eventAction' => 'Play',
    'eventLabel' => 'Gone With the Wind',
    'eventValue' => 1,
    'nonInteraction' => TRUE,
  ];
  $this->pushes[GA_PUSH_TYPE_EVENT]['ca'] = [
    'eventCategory' => 'Videos',
    'eventAction' => 'Play',
  ];

  // Social:
  $this->pushes[GA_PUSH_TYPE_SOCIAL]['nat'] = [
    'socialNetwork' => 'facebook',
    'socialAction' => 'like',
    'socialTarget' => 'http://mycoolpage.com',
  ];
  $this->pushes[GA_PUSH_TYPE_SOCIAL]['n'] = [
    'socialNetwork' => 'facebook',
  ];
}