You are here

public function MetatagTestBase::debugLocalesTargetsByContext in Metatag 7

Generate a dump of the {locales_target} records for a specific context.

Parameters

string $context: The translation context to search against.

1 call to MetatagTestBase::debugLocalesTargetsByContext()
MetatagTestBase::saveTranslationString in tests/MetatagTestBase.test
Save a {locales_target} translation string to the database.

File

tests/MetatagTestBase.test, line 533
A base class for the Metatag tests, provides shared methods.

Class

MetatagTestBase
A base class for the Metatag tests, provides shared methods.

Code

public function debugLocalesTargetsByContext($context) {

  // , lt.i18n_status
  $records = db_query("SELECT lt.lid, lt.translation, lt.language, lt.plid, lt.plural\n      FROM {locales_target} lt\n        INNER JOIN {locales_source} ls\n          ON lt.lid = ls.lid\n      WHERE ls.textgroup = 'metatag'\n        AND ls.context = :context", array(
    ':context' => $context,
  ))
    ->fetchAllAssoc('lid');
  foreach ($records as $key => $record) {
    $records[$key] = (array) $record;
  }
  $args = array(
    'caption' => 'Locale target check for . ' . $context,
    'header' => array(
      'lid',
      'translation',
      'language',
      'plid',
      'plural',
    ),
    'rows' => $records,
  );
  $this
    ->verbose(theme('table', $args));
}