Laravel version update
Laravel version update
This commit is contained in:
@@ -11,10 +11,11 @@
|
||||
|
||||
namespace Symfony\Component\Translation\Tests\Dumper;
|
||||
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Translation\Dumper\CsvFileDumper;
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
|
||||
class CsvFileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
class CsvFileDumperTest extends TestCase
|
||||
{
|
||||
public function testFormatCatalogue()
|
||||
{
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
|
||||
namespace Symfony\Component\Translation\Tests\Dumper;
|
||||
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Translation\Dumper\FileDumper;
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
|
||||
class FileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
class FileDumperTest extends TestCase
|
||||
{
|
||||
public function testDump()
|
||||
{
|
||||
@@ -26,27 +27,9 @@ class FileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
$dumper = new ConcreteFileDumper();
|
||||
$dumper->dump($catalogue, array('path' => $tempDir));
|
||||
|
||||
$this->assertTrue(file_exists($tempDir.'/messages.en.concrete'));
|
||||
}
|
||||
$this->assertFileExists($tempDir.'/messages.en.concrete');
|
||||
|
||||
public function testDumpBackupsFileIfExisting()
|
||||
{
|
||||
$tempDir = sys_get_temp_dir();
|
||||
$file = $tempDir.'/messages.en.concrete';
|
||||
$backupFile = $file.'~';
|
||||
|
||||
@touch($file);
|
||||
|
||||
$catalogue = new MessageCatalogue('en');
|
||||
$catalogue->add(array('foo' => 'bar'));
|
||||
|
||||
$dumper = new ConcreteFileDumper();
|
||||
$dumper->dump($catalogue, array('path' => $tempDir));
|
||||
|
||||
$this->assertTrue(file_exists($backupFile));
|
||||
|
||||
@unlink($file);
|
||||
@unlink($backupFile);
|
||||
@unlink($tempDir.'/messages.en.concrete');
|
||||
}
|
||||
|
||||
public function testDumpCreatesNestedDirectoriesAndFile()
|
||||
@@ -62,7 +45,7 @@ class FileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
$dumper->setRelativePathTemplate('test/translations/%domain%.%locale%.%extension%');
|
||||
$dumper->dump($catalogue, array('path' => $tempDir));
|
||||
|
||||
$this->assertTrue(file_exists($file));
|
||||
$this->assertFileExists($file);
|
||||
|
||||
@unlink($file);
|
||||
@rmdir($translationsDir);
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
|
||||
namespace Symfony\Component\Translation\Tests\Dumper;
|
||||
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Translation\Dumper\IcuResFileDumper;
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
|
||||
class IcuResFileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
class IcuResFileDumperTest extends TestCase
|
||||
{
|
||||
public function testFormatCatalogue()
|
||||
{
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
|
||||
namespace Symfony\Component\Translation\Tests\Dumper;
|
||||
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Translation\Dumper\IniFileDumper;
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
|
||||
class IniFileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
class IniFileDumperTest extends TestCase
|
||||
{
|
||||
public function testFormatCatalogue()
|
||||
{
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
|
||||
namespace Symfony\Component\Translation\Tests\Dumper;
|
||||
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Translation\Dumper\JsonFileDumper;
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
|
||||
class JsonFileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
class JsonFileDumperTest extends TestCase
|
||||
{
|
||||
public function testFormatCatalogue()
|
||||
{
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
|
||||
namespace Symfony\Component\Translation\Tests\Dumper;
|
||||
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Translation\Dumper\MoFileDumper;
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
|
||||
class MoFileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
class MoFileDumperTest extends TestCase
|
||||
{
|
||||
public function testFormatCatalogue()
|
||||
{
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
|
||||
namespace Symfony\Component\Translation\Tests\Dumper;
|
||||
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Translation\Dumper\PhpFileDumper;
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
|
||||
class PhpFileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
class PhpFileDumperTest extends TestCase
|
||||
{
|
||||
public function testFormatCatalogue()
|
||||
{
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
|
||||
namespace Symfony\Component\Translation\Tests\Dumper;
|
||||
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Translation\Dumper\PoFileDumper;
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
|
||||
class PoFileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
class PoFileDumperTest extends TestCase
|
||||
{
|
||||
public function testFormatCatalogue()
|
||||
{
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
|
||||
namespace Symfony\Component\Translation\Tests\Dumper;
|
||||
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Translation\Dumper\QtFileDumper;
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
|
||||
class QtFileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
class QtFileDumperTest extends TestCase
|
||||
{
|
||||
public function testFormatCatalogue()
|
||||
{
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
|
||||
namespace Symfony\Component\Translation\Tests\Dumper;
|
||||
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Translation\Dumper\XliffFileDumper;
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
|
||||
class XliffFileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
class XliffFileDumperTest extends TestCase
|
||||
{
|
||||
public function testFormatCatalogue()
|
||||
{
|
||||
@@ -86,4 +87,29 @@ class XliffFileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
$dumper->formatCatalogue($catalogue, 'messages', array('default_locale' => 'fr_FR'))
|
||||
);
|
||||
}
|
||||
|
||||
public function testFormatCatalogueWithNotesMetadata()
|
||||
{
|
||||
$catalogue = new MessageCatalogue('en_US');
|
||||
$catalogue->add(array(
|
||||
'foo' => 'bar',
|
||||
'baz' => 'biz',
|
||||
));
|
||||
$catalogue->setMetadata('foo', array('notes' => array(
|
||||
array('category' => 'state', 'content' => 'new'),
|
||||
array('category' => 'approved', 'content' => 'true'),
|
||||
array('category' => 'section', 'content' => 'user login', 'priority' => '1'),
|
||||
)));
|
||||
$catalogue->setMetadata('baz', array('notes' => array(
|
||||
array('id' => 'x', 'content' => 'x_content'),
|
||||
array('appliesTo' => 'target', 'category' => 'quality', 'content' => 'Fuzzy'),
|
||||
)));
|
||||
|
||||
$dumper = new XliffFileDumper();
|
||||
|
||||
$this->assertStringEqualsFile(
|
||||
__DIR__.'/../fixtures/resources-notes-meta.xlf',
|
||||
$dumper->formatCatalogue($catalogue, 'messages', array('default_locale' => 'fr_FR', 'xliff_version' => '2.0'))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
|
||||
namespace Symfony\Component\Translation\Tests\Dumper;
|
||||
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Translation\Dumper\YamlFileDumper;
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
|
||||
class YamlFileDumperTest extends \PHPUnit_Framework_TestCase
|
||||
class YamlFileDumperTest extends TestCase
|
||||
{
|
||||
public function testTreeFormatCatalogue()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user