You are here

private function PotxTest::parseFile in Translation template extractor 8

Parse the given file with the given API version.

14 calls to PotxTest::parseFile()
PotxTest::testDrupal5 in tests/src/Kernel/PotxTest.php
Test parsing of Drupal 5 module.
PotxTest::testDrupal6 in tests/src/Kernel/PotxTest.php
Test parsing of Drupal 6 module.
PotxTest::testDrupal7 in tests/src/Kernel/PotxTest.php
Test parsing of Drupal 7 module.
PotxTest::testDrupal8 in tests/src/Kernel/PotxTest.php
Test parsing of Drupal 8 module.
PotxTest::testDrupal8BreakpointsYml in tests/src/Kernel/PotxTest.php
Test parsing of Drupal 8 .breakpoints.yml files.

... See full list

File

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

Class

PotxTest
Ensure that the translation template extractor functions properly.

Namespace

Drupal\Tests\potx\Kernel

Code

private function parseFile($filename, $api_version, $string_mode = POTX_STRING_RUNTIME) {
  global $_potx_store, $_potx_strings, $_potx_install;
  $_potx_store = $_potx_strings = $_potx_install = [];
  potx_status('set', POTX_STATUS_STRUCTURED);
  _potx_process_file($filename, 0, '_potx_save_string', '_potx_save_version', $api_version);
  _potx_build_files($string_mode, POTX_BUILD_SINGLE, 'general', '_potx_save_string', '_potx_save_version', '_potx_get_header', NULL, NULL, $api_version);

  // Grab .po representation of parsed content.
  ob_start();
  _potx_write_files('potx-test.po');
  $this->potx_output = ob_get_clean();

  // debug(var_export($this->potx_output, TRUE));.
  $this->potx_status = potx_status('get', TRUE);

  // debug(var_export($this->potx_status, TRUE));.
}