You are here

protected function DraftyTitleTestCase::checkLegacyValues in Drafty 7

Checks that the legacy field values stored in the database match the given values.

1 call to DraftyTitleTestCase::checkLegacyValues()
DraftyTitleTestCase::testProgrammaticTranslationWorkflow in tests/DraftyTitleTestCase.test
Tests title module interaction with draft translation creation.

File

tests/DraftyTitleTestCase.test, line 239

Class

DraftyTitleTestCase
Tests for legacy field replacement.

Code

protected function checkLegacyValues($node, $values) {
  $record = db_query('SELECT * FROM {node} n WHERE n.nid = :nid', array(
    ':nid' => $node->nid,
  ))
    ->fetchAssoc();
  foreach ($values as $name => $value) {
    debug($record[$name]);
    debug($value);
    if ($record[$name] != $value) {
      return FALSE;
    }
  }
  return TRUE;
}