You are here

public function MetatagTestBase::getTranslationLidByContext in Metatag 7

Get the {locales_source} lid value for a specific context.

Parameters

string $context: The context string to search for.

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

Return value

int The {locales_source}.lid value for this string.

13 calls to MetatagTestBase::getTranslationLidByContext()
MetatagContextWithI18nTest::testContextI18n in metatag_context/tests/MetatagContextWithI18nTest.test
Verify that strings are added to the translation system.
MetatagContextWithI18nTest::testExportedContext in metatag_context/tests/MetatagContextWithI18nTest.test
Test the Metatag:Context translations for an exported configuration.
MetatagCoreNodeWithI18nTest::testI18nNodeConfig in tests/MetatagCoreNodeWithI18nTest.test
Test translations of the main node configuration.
MetatagCoreNodeWithI18nTest::testI18nNodePageConfig in tests/MetatagCoreNodeWithI18nTest.test
Test translations of the 'page' content type configuration.
MetatagCoreTermWithI18nTest::testI18nTermConfig in tests/MetatagCoreTermWithI18nTest.test
Test translations of the main taxonomy term configuration.

... See full list

File

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

  // Extra debug output.
  $this
    ->debugLocalesSourcesByContext($context);

  // Look for the string that's actually being requested.
  return (int) db_query("SELECT lid\n      FROM {locales_source}\n      WHERE textgroup = :textgroup\n      AND context = :context", array(
    ':textgroup' => $textgroup,
    ':context' => $context,
  ))
    ->fetchField();
}