function YandexMetricsCounterTestCase::setUp in Yandex.Metrics 7.2
Same name and namespace in other branches
- 7.3 yandex_metrics.test \YandexMetricsCounterTestCase::setUp()
Test case presets.
Return value
bool|void
Overrides DrupalWebTestCase::setUp
File
- ./
yandex_metrics.test, line 38 - Tests for Yandex.Metrics Counter module.
Class
- YandexMetricsCounterTestCase
- Tests of functionality and settings of Yandex.Metrics Counter module.
Code
function setUp() {
// Install the Yandex.Metrics Counter module.
parent::setUp('yandex_metrics');
// Set simple string as counter code.
$this->yandex_metrics_code = '<!-- Yandex.Metrika counter -->' . $this
->randomName(8);
variable_set('yandex_metrics_counter_code', $this->yandex_metrics_code);
// 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);
}