print_exported_file() public method

public print_exported_file ( $project, $locale, $translation_set, $entries )
示例#1
0
 /**
  * @ticket GH-450
  */
 public function test_po_export_includes_project_id_version_header()
 {
     if ('GP_Format_PO' !== get_class($this->format)) {
         $this->markTestSkipped();
     }
     $parent_project_one = $this->factory->project->create();
     $parent_project_two = $this->factory->project->create(array('parent_project_id' => $parent_project_one->id));
     $set = $this->factory->translation_set->create_with_project_and_locale(array(), array('parent_project_id' => $parent_project_two->id));
     $project = $set->project;
     $locale = $this->factory->locale->create();
     $entries_for_export = $this->get_entries_for_export($set);
     $file = $this->format->print_exported_file($project, $locale, $set, $entries_for_export);
     $expected = sprintf('"Project-Id-Version: %s - %s - %s\\n"', $parent_project_one->name, $parent_project_two->name, $project->name);
     $this->assertContains($expected, $file);
 }