You are here

public function PotxTestCase::testDrupal8LocalContextualYml in Translation template extractor 7.2

Same name and namespace in other branches
  1. 6.3 tests/potx.test \PotxTestCase::testDrupal8LocalContextualYml()
  2. 7.3 tests/potx.test \PotxTestCase::testDrupal8LocalContextualYml()

Test parsing of Drupal 8 local tasks, contextual link and action files.

File

tests/potx.test, line 307
Tests to ensure that the template extractor works as intended.

Class

PotxTestCase
@file Tests to ensure that the template extractor works as intended.

Code

public function testDrupal8LocalContextualYml() {
  $filenames = array(
    drupal_get_path('module', 'potx') . '/tests/potx_test_8.links.task.yml',
    drupal_get_path('module', 'potx') . '/tests/potx_test_8.links.action.yml',
    drupal_get_path('module', 'potx') . '/tests/potx_test_8.links.contextual.yml',
  );
  $this
    ->parseFile($filenames[0], POTX_API_8);
  $this
    ->assertMsgID('Local task translation test');
  $this
    ->assertMsgIDContext('Local task translation with context test', 'Local task context');
  $this
    ->parseFile($filenames[1], POTX_API_8);
  $this
    ->assertMsgID('Local action translation test');
  $this
    ->assertMsgIDContext('Local action translation with context test', 'Local action context');
  $this
    ->parseFile($filenames[2], POTX_API_8);
  $this
    ->assertMsgID('Test Contextual link');
  $this
    ->assertMsgIDContext('Test Contextual link with context', 'Contextual Context');
}