You are here

public function PotxTest::testDrupal8LocalContextualYml in Translation template extractor 8

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

File

tests/src/Kernel/PotxTest.php, line 420

Class

PotxTest
Ensure that the translation template extractor functions properly.

Namespace

Drupal\Tests\potx\Kernel

Code

public function testDrupal8LocalContextualYml() {
  $filenames = [
    $this->tests_root . '/potx_test_8.links.task.yml',
    $this->tests_root . '/potx_test_8.links.action.yml',
    $this->tests_root . '/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
    ->assertPotxErrors([]);
  $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
    ->assertPotxErrors([]);
  $this
    ->parseFile($filenames[2], POTX_API_8);
  $this
    ->assertMsgId('Test Contextual link');
  $this
    ->assertMsgIdContext('Test Contextual link with context', 'Contextual Context');
  $this
    ->assertPotxErrors([]);
}