Skip to content

Commit

Permalink
Merge pull request #159 from remicollet/issue-bugendian
Browse files Browse the repository at this point in the history
don't check Po file content on bigendian
  • Loading branch information
oscarotero authored Feb 26, 2018
2 parents 37882dc + 063cf0e commit 99e1abc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ protected function assertContent(Translations $translations, $file, $format = nu
$method = "to{$format}String";
$content = file_get_contents(static::asset($file.'.'.static::$ext[$format]));

$this->assertSame($content, $translations->$method(), $file);
// Po reference files are LittleEndian
if ($format !== 'Mo' || self::isLittleEndian()) {
$this->assertSame($content, $translations->$method(), $file);
}
}

protected static function saveContent(Translations $translations, $file, $format = null)
Expand All @@ -78,4 +81,9 @@ protected function runTestFormat($file, $countTranslations, $countTranslated = 0
$this->assertSame($countTranslated, $translations->countTranslated());
$this->assertContent($translations, $file);
}

protected function isLittleEndian()
{
return pack("s", 0x3031) === "10";
}
}

0 comments on commit 99e1abc

Please sign in to comment.