You are here

private function PotxTestCase::parseFile in Translation template extractor 7.2

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

Parse the given file with the given API version.

16 calls to PotxTestCase::parseFile()
PotxTestCase::testDrupal5 in tests/potx.test
Test parsing of Drupal 5 module.
PotxTestCase::testDrupal6 in tests/potx.test
Test parsing of Drupal 6 module.
PotxTestCase::testDrupal7 in tests/potx.test
Test parsing of Drupal 7 module.
PotxTestCase::testDrupal8 in tests/potx.test
Test parsing of Drupal 8 module.
PotxTestCase::testDrupal8BreakpointsYml in tests/potx.test
Test parsing of Drupal 8 .breakpoints.yml files.

... See full list

File

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

Class

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

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 = array();
  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));
}