private function StatisticsAdvancedTestCase::assertNodeCount in Statistics Advanced 6
Private function to test node counters.
Parameters
$nid: An integer with the node ID.
$count: An integer with the expected node counter value.
2 calls to StatisticsAdvancedTestCase::assertNodeCount()
- StatisticsAdvancedTestCase::testInvalidNodeCounter in ./
statistics_advanced.test - Test that an invalid nodes will not cause a record to be added to the node_counter table.
- StatisticsAdvancedTestCase::testNodeCounter in ./
statistics_advanced.test
File
- ./
statistics_advanced.test, line 122 - Unit tests for the statistics_advanced module.
Class
- StatisticsAdvancedTestCase
- Test basic statistics advanced functionality.
Code
private function assertNodeCount($nid, $count) {
$this
->drupalGet("node/{$nid}");
$db_count = db_result(db_query("SELECT totalcount FROM {node_counter} WHERE nid = %d", $nid));
$this
->assertEqual($db_count, $count, t('Node @nid counter expected @expected-count, actual @actual-count.', array(
'@actual-count' => $db_count,
'@expected-count' => $count,
'@nid' => $nid,
)));
}