You are here

protected function WorkbenchModerationExternalNodeUpdateTestCase::getModerationRecord in Workbench Moderation 7

Same name and namespace in other branches
  1. 7.3 tests/external_node_update.test \WorkbenchModerationExternalNodeUpdateTestCase::getModerationRecord()

Returns a moderation status record of the tested node.

Parameters

string $status: Which status to return. Can be either 'current' or 'published'.

Return value

array The node's record(s) from the {workbench_moderation_node_history} table.

2 calls to WorkbenchModerationExternalNodeUpdateTestCase::getModerationRecord()
WorkbenchModerationExternalNodeUpdateTestCase::assertModerationStatus in tests/external_node_update.test
Checks if the node history table matches the expected values.
WorkbenchModerationExternalNodeUpdateTestCase::assertNoPublishedRecord in tests/external_node_update.test
Checks if the node is not marked as 'published' in the node history table.

File

tests/external_node_update.test, line 180
Tests moderation states when nodes are (un)published by other modules.

Class

WorkbenchModerationExternalNodeUpdateTestCase
@file Tests moderation states when nodes are (un)published by other modules.

Code

protected function getModerationRecord($status = 'is_current') {
  return db_select('workbench_moderation_node_history', 'nh')
    ->fields('nh', array(
    'from_state',
    'state',
    'published',
    'is_current',
  ))
    ->condition('nid', $this->node->nid, '=')
    ->condition($status, 1)
    ->execute()
    ->fetchAssoc();
}