Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using xliff version 2.0 as default (#12)
* Using xliff version 2.0 as default * Applied changes from StyleCI * Removed PHP7 code * Removed PHP 7 code * Fixed SF2.7 * Applied changes from StyleCI
- Loading branch information
Showing
5 changed files
with
254 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the PHP Translation package. | ||
* | ||
* (c) PHP Translation team <tobias.nyholm@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Translation\SymfonyStorage\Tests\Unit\Dumper; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\Translation\MessageCatalogue; | ||
use Translation\SymfonyStorage\Dumper\XliffDumper; | ||
|
||
class XliffDumperTest extends TestCase | ||
{ | ||
public function testDumpXliff2Meta() | ||
{ | ||
$catalogue = new MessageCatalogue('en'); | ||
$catalogue->set('key0', 'trans0'); | ||
$catalogue->setMetadata('key0', ['notes' => [ | ||
['content' => 'yes', 'category' => 'approved'], | ||
['content' => 'new', 'category' => 'state'], | ||
]]); | ||
|
||
$catalogue->set('key1', 'trans1'); | ||
$catalogue->setMetadata('key1', ['notes' => [ | ||
['content' => 'cnt', 'priority' => '2'], | ||
]]); | ||
|
||
$dumper = new XliffDumper(); | ||
$output = $dumper->formatCatalogue($catalogue, 'messages', ['xliff_version' => '2.0']); | ||
|
||
$this->assertContains('<note category="approved">yes</note>', $output); | ||
$this->assertContains('<note category="state">new</note>', $output); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters