public function SchedulerTestBase::assertRevisionCount in Scheduler 7
Check if the number of revisions for a node matches a given value.
Parameters
int $nid: The node id of the node to check.
string $value: The value with which the number of revisions will be compared.
string $message: The message to display along with the assertion.
string $group: The type of assertion - examples are "Browser", "PHP".
Return value
bool TRUE if the assertion succeeded, FALSE otherwise.
1 call to SchedulerTestBase::assertRevisionCount()
- SchedulerFunctionalTest::testRevisioning in tests/
scheduler.test - Tests the creation of new revisions on scheduling.
File
- tests/
scheduler.test, line 175 - Scheduler module test case file.
Class
- SchedulerTestBase
- Provides common helper methods for Scheduler module tests.
Code
public function assertRevisionCount($nid, $value, $message = '', $group = 'Other') {
$count = db_select('node_revision', 'r')
->fields('r', array(
'vid',
))
->condition('nid', $nid)
->countQuery()
->execute()
->fetchColumn();
return $this
->assertEqual($count, $value, $message, $group);
}