예제 #1
0
 /**
  * Test update comments
  */
 public function testUpdateComments()
 {
     $fileHandler = new FileHandler(__DIR__ . '/pofiles/context.po');
     $parser = new PoParser($fileHandler);
     $entries = $parser->parse();
     $options = $parser->getOptions();
     $ctxtGlue = $options['context-glue'];
     $msgid = 'Background Attachment' . $ctxtGlue . 'Attachment';
     $entry = $entries[$msgid];
     $entry['ccomment'] = array('Test write ccomment');
     $entry['tcomment'] = array('Test write tcomment');
     $parser->setEntry($msgid, $entry);
     $parser->writeFile(__DIR__ . '/pofiles/temp.po');
     $parser = PoParser::parseFile(__DIR__ . '/pofiles/temp.po');
     $entries = $parser->getEntries();
     $this->assertEquals($entries[$msgid]['tcomment'][0], $entry['tcomment'][0]);
     $this->assertEquals($entries[$msgid]['ccomment'][0], $entry['ccomment'][0]);
 }