StateFlowSPSTestUnit.test in State Machine 7.2
File
modules/state_flow_sps/tests/StateFlowSPSTestUnit.test
View source
<?php
class SPSTestStateFlowUnitTest extends SPSBaseUnitTest {
static function getInfo() {
return array(
'name' => 'SPS Test State Flow Unit Tests',
'description' => 'Test the functionality of the StateFlowOverride object',
'group' => 'SPSIntegration',
);
}
public function testStateFlowOverride() {
$data = array(
'node' => array(
array(
'nid' => 2,
'vid' => 5,
),
array(
'nid' => 3,
'vid' => 8,
),
array(
'nid' => 2,
'vid' => 3,
),
),
);
$state_flow_override = new \Drupal\state_flow_sps\Test\StateFlowTestOverride(array(), new Drupal\sps\Test\Manager());
$state_flow_override
->setResults($data);
$overrides = $state_flow_override
->getOverrides();
$this
->assertEqual($overrides['node-2']['vid'], 5, 'StateFlowOverride should take the last published revision.');
}
}