composer update

This commit is contained in:
2019-06-23 10:14:30 +00:00
parent a56db5ea2b
commit ec4506ebf4
790 changed files with 35767 additions and 7663 deletions

View File

@@ -84,7 +84,17 @@ class XliffFileLoaderTest extends TestCase
$this->assertEquals(utf8_decode('föö'), $catalogue->get('bar', 'domain1'));
$this->assertEquals(utf8_decode('bär'), $catalogue->get('foo', 'domain1'));
$this->assertEquals(['notes' => [['content' => utf8_decode('bäz')]], 'id' => '1'], $catalogue->getMetadata('foo', 'domain1'));
$this->assertEquals(
[
'source' => 'foo',
'notes' => [['content' => utf8_decode('bäz')]],
'id' => '1',
'file' => [
'original' => 'file.ext',
],
],
$catalogue->getMetadata('foo', 'domain1')
);
}
public function testTargetAttributesAreStoredCorrectly()
@@ -164,11 +174,44 @@ class XliffFileLoaderTest extends TestCase
$loader = new XliffFileLoader();
$catalogue = $loader->load(__DIR__.'/../fixtures/withnote.xlf', 'en', 'domain1');
$this->assertEquals(['notes' => [['priority' => 1, 'content' => 'foo']], 'id' => '1'], $catalogue->getMetadata('foo', 'domain1'));
$this->assertEquals(
[
'source' => 'foo',
'notes' => [['priority' => 1, 'content' => 'foo']],
'id' => '1',
'file' => [
'original' => 'file.ext',
],
],
$catalogue->getMetadata('foo', 'domain1')
);
// message without target
$this->assertEquals(['notes' => [['content' => 'bar', 'from' => 'foo']], 'id' => '2'], $catalogue->getMetadata('extra', 'domain1'));
$this->assertEquals(
[
'source' => 'extrasource',
'notes' => [['content' => 'bar', 'from' => 'foo']],
'id' => '2',
'file' => [
'original' => 'file.ext',
],
],
$catalogue->getMetadata('extra', 'domain1')
);
// message with empty target
$this->assertEquals(['notes' => [['content' => 'baz'], ['priority' => 2, 'from' => 'bar', 'content' => 'qux']], 'id' => '123'], $catalogue->getMetadata('key', 'domain1'));
$this->assertEquals(
[
'source' => 'key',
'notes' => [
['content' => 'baz'],
['priority' => 2, 'from' => 'bar', 'content' => 'qux'],
],
'id' => '123',
'file' => [
'original' => 'file.ext',
],
],
$catalogue->getMetadata('key', 'domain1')
);
}
public function testLoadVersion2()
@@ -257,4 +300,32 @@ class XliffFileLoaderTest extends TestCase
$this->assertSame('processed', $metadata['notes'][0]['category']);
$this->assertSame('true', $metadata['notes'][0]['content']);
}
public function testLoadWithMultipleFileNodes()
{
$loader = new XliffFileLoader();
$catalogue = $loader->load(__DIR__.'/../fixtures/resources-multi-files.xlf', 'en', 'domain1');
$this->assertEquals(
[
'source' => 'foo',
'id' => '1',
'file' => [
'original' => 'file.ext',
],
],
$catalogue->getMetadata('foo', 'domain1')
);
$this->assertEquals(
[
'source' => 'test',
'notes' => [['content' => 'note']],
'id' => '4',
'file' => [
'original' => 'otherfile.ext',
],
],
$catalogue->getMetadata('test', 'domain1')
);
}
}