public function YandexMetricsCounterTestCase::setUp in Yandex.Metrics 7.3
Same name and namespace in other branches
- 7.2 yandex_metrics.test \YandexMetricsCounterTestCase::setUp()
Test case presets.
Overrides DrupalWebTestCase::setUp
File
- ./
yandex_metrics.test, line 37 - Tests for Yandex.Metrics Counter module.
Class
- YandexMetricsCounterTestCase
- Tests of functionality and settings of Yandex.Metrics Counter module.
Code
public function setUp() {
// Install the Yandex.Metrics Counter module.
parent::setUp('yandex_metrics');
// Set simple string as counter code.
$this->yandexMetricsCode = '<!-- Yandex.Metrika counter -->' . $this
->randomName(8);
variable_set('yandex_metrics_counter_code', $this->yandexMetricsCode);
// Create admin user.
$admin_user_permissions = array(
'administer Yandex.Metrics settings',
'access administration pages',
'access content overview',
);
$this->admin_user = $this
->drupalCreateUser($admin_user_permissions);
// Create regular user.
$regular_user_permissions = array(
'access content',
'access comments',
);
$this->regular_user = $this
->drupalCreateUser($regular_user_permissions);
}