function StatsproTestCase::testPosNavegationState in Statistics Pro 6.2
Same name and namespace in other branches
- 6 tests/statspro.test \StatsproTestCase::testPosNavegationState()
File
- tests/statspro.test, line 1169
- Functionality tests for Statistics Pro.
Class
- StatsproTestCase
- Class resposible for testing the statspro class.
Code
function testPosNavegationState() {
$this
->createInitialData();
$this
->drupalLogin($this->users['stats_admin']);
$edit = array(
'statistics_enable_access_log' => 1,
'statistics_flush_accesslog_timer' => 9676800,
);
$this
->drupalPost('admin/reports/settings', $edit, t('Save configuration'));
$this
->drupalLogout();
$this
->drupalGetNodeByTitle(t('Node !this/!total - now', array(
'!this' => 1,
'!total' => 1,
)));
$this
->drupalGetNodeByTitle(t('Node !this/!total - last week', array(
'!this' => 2,
'!total' => 2,
)));
$this
->drupalGetNodeByTitle(t('Node !this/!total - last year', array(
'!this' => 2,
'!total' => 3,
)));
$this
->drupalGet('node/111');
$this
->drupalGet('node/1099');
$this
->drupalLogin($this->users['regular_3']);
$this
->drupalGetNodeByTitle(t('Node !this/!total - last week', array(
'!this' => 2,
'!total' => 2,
)));
$this
->drupalGetNodeByTitle(t('Node !this/!total - last month', array(
'!this' => 1,
'!total' => 1,
)));
$this
->drupalGetNodeByTitle(t('Node !this/!total - last week', array(
'!this' => 1,
'!total' => 2,
)));
$this
->drupalGetNodeByTitle(t('Node !this/!total - now', array(
'!this' => 1,
'!total' => 1,
)));
$this
->drupalGet('node/700');
$this
->drupalGet('node/199');
$this
->drupalLogin($this->users['regular_1']);
$this
->drupalGetNodeByTitle(t('Node !this/!total - last week', array(
'!this' => 1,
'!total' => 2,
)));
$this
->drupalGetNodeByTitle(t('Node !this/!total - now', array(
'!this' => 1,
'!total' => 1,
)));
$this
->drupalGetNodeByTitle(t('Node !this/!total - last year', array(
'!this' => 1,
'!total' => 3,
)));
$this
->callCron();
$group = t('General statspro class tests');
$correct = 10 + 11;
$this
->completeTestAggregatedData('pi', $correct, $group);
$this
->completeTestAggregatedData('upi', 10, $group);
$this
->completeTestAggregatedData('error', 0, $group);
$this
->completeTestAggregatedData('uerror', 0, $group);
$this
->completeTestAggregatedData('warning', 4, $group);
$this
->completeTestAggregatedData('uwarning', 2, $group);
$this
->completeTestAggregatedData('emergency', 0, $group);
$this
->completeTestAggregatedData('uemergency', 0, $group);
$this
->completeTestAggregatedData('alert', 0, $group);
$this
->completeTestAggregatedData('ualert', 0, $group);
$this
->completeTestAggregatedData('critical', 0, $group);
$this
->completeTestAggregatedData('ucritical', 0, $group);
$correct = 2 + count($this->users);
$this
->completeTestAggregatedData('users', $correct, $group);
$this
->completeTestAggregatedData('terms', 0, $group);
$correct = count($this->node_titles);
$this
->completeTestAggregatedData('nodes', $correct, $group);
$correct = 2;
$this
->completeTestAggregatedData('node_types', $correct, $group);
$this
->completeTestAggregatedData('comments', 0, $group);
$this
->completeTestAggregatedData('aliases', 0, $group);
$this
->completeTestAggregatedData('sessions', 1, $group);
$correct = 11 + count($this->modules);
$this
->completeTestAggregatedData('modules', $correct, $group);
}