Skip to content

Commit

Permalink
Merge pull request #299 from pedro-mendonca/php-8-3-test
Browse files Browse the repository at this point in the history
Support for PHP >= 8.2
  • Loading branch information
oscarotero authored Jul 24, 2024
2 parents 5e7551f + b8bc186 commit 73c501a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Generator/MoGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function generateString(Translations $translations): string
$messages[$originalString] = $translation;
}

ksort($messages);
ksort($messages, SORT_STRING);
$numEntries = count($messages);
$originalsTable = '';
$translationsTable = '';
Expand Down
6 changes: 5 additions & 1 deletion tests/MoGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public function testMoGenerator()
$translation->translate('Comentario deshabilitado');
$translations->add($translation);

$translation = Translation::create(null, '15');
$translation->translate('15');
$translations->add($translation);

$translation = Translation::create(null, '123456');
$translation->translate('12345');
$translations->add($translation);
Expand All @@ -47,7 +51,7 @@ public function testMoGenerator()

$result = $loader->loadString($mo);

$this->assertCount(3, $result);
$this->assertCount(4, $result);
$this->assertCount(5, $result->getHeaders());
}
}
Binary file modified tests/assets/mo-generator-result.mo
Binary file not shown.

0 comments on commit 73c501a

Please sign in to comment.