apply some fixes.

This commit is contained in:
Abdellatif Ait boudad 2015-09-07 18:17:00 +00:00
parent ce540aeaf9
commit ace6042d89
2 changed files with 4 additions and 5 deletions

View File

@ -60,7 +60,7 @@ class XliffFileLoader implements LoaderInterface
}
$xliffVersion = $this->getVersionNumber($dom);
$this->validateSchema($xliffVersion, $dom, $this->getSchema($xliffVersion, $dom));
$this->validateSchema($xliffVersion, $dom, $this->getSchema($xliffVersion));
if ('1.2' === $xliffVersion) {
$this->extractXliff1($dom, $catalogue, $domain);
@ -159,6 +159,7 @@ class XliffFileLoader implements LoaderInterface
}
/**
* @param string $file
* @param \DOMDocument $dom
* @param string $schema source of the schema
*
@ -178,10 +179,7 @@ class XliffFileLoader implements LoaderInterface
libxml_use_internal_errors($internalErrors);
}
/**
* @return string
*/
private function getSchema($xliffVersion, $dom)
private function getSchema($xliffVersion)
{
if ('1.2' === $xliffVersion) {
$schemaSource = file_get_contents(__DIR__.'/schema/dic/xliff-core/xliff-core-1.2-strict.xsd');

View File

@ -162,6 +162,7 @@ class XliffFileLoaderTest extends \PHPUnit_Framework_TestCase
$domains = $catalogue->all();
$this->assertCount(3, $domains['domain1']);
$this->assertContainsOnly('string', $catalogue->all('domain1'));
// Notes aren't assigned to specific segments, but to whole units, so there's no way to do a mapping
$this->assertEmpty($catalogue->getMetadata());