| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 23 | 
| Code Lines | 16 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 13 | public function testUpdateComments() | ||
| 14 |     { | ||
| 15 | $fileHandler = new FileHandler($this->resourcesPath.'context.po'); | ||
| 16 | $parser = new PoParser($fileHandler); | ||
| 17 | $entries = $parser->parse(); | ||
| 18 | $options = $parser->getOptions(); | ||
| 19 | $ctxtGlue = $options['context-glue']; | ||
| 20 | |||
| 21 | $msgid = 'Background Attachment'.$ctxtGlue.'Attachment'; | ||
| 22 | $entry = $entries[$msgid]; | ||
| 23 | |||
| 24 |         $entry['ccomment'] = array('Test write ccomment'); | ||
| 25 |         $entry['tcomment'] = array('Test write tcomment'); | ||
| 26 | |||
| 27 | $parser->setEntry($msgid, $entry); | ||
| 28 | $parser->writeFile($this->resourcesPath.'temp.po'); | ||
| 29 | |||
| 30 | $parser = PoParser::parseFile($this->resourcesPath.'temp.po'); | ||
| 31 | $entries = $parser->getEntries(); | ||
| 32 | |||
| 33 | $this->assertEquals($entries[$msgid]['tcomment'][0], $entry['tcomment'][0]); | ||
| 34 | $this->assertEquals($entries[$msgid]['ccomment'][0], $entry['ccomment'][0]); | ||
| 35 | } | ||
| 36 | } | ||
| 37 |