You are here

public function MetatagTestBase::debugLocalesSourcesByContext in Metatag 7

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

Parameters

string $context: The translation context to search against.

string $textgroup: This string's textgroup; defaults to 'metatag'.

2 calls to MetatagTestBase::debugLocalesSourcesByContext()
MetatagTestBase::getTranslationLidByContext in tests/MetatagTestBase.test
Get the {locales_source} lid value for a specific context.
MetatagTestBase::getTranslationLidBySource in tests/MetatagTestBase.test
Get the {locales_source} lid value for a specific source.

File

tests/MetatagTestBase.test, line 434
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 debugLocalesSourcesByContext($context, $textgroup = 'metatag') {

  // Get a dump of all i18n strings for Metatag.
  $records = db_query("SELECT lid, location, textgroup, source, context, version\n      FROM {locales_source}\n      WHERE textgroup = :textgroup", array(
    ':textgroup' => $textgroup,
  ))
    ->fetchAllAssoc('lid');
  foreach ($records as $key => $record) {
    $records[$key] = (array) $record;
  }
  $args = array(
    'caption' => 'i18n source check for . ' . $context,
    'header' => array(
      'lid',
      'location',
      'textgroup',
      'source',
      'context',
      'version',
    ),
    'rows' => $records,
  );
  $this
    ->verbose(theme('table', $args));
}