Skip to content

Commit 73c501a

Browse files
authored
Merge pull request #299 from pedro-mendonca/php-8-3-test
Support for PHP >= 8.2
2 parents 5e7551f + b8bc186 commit 73c501a

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/Generator/MoGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function generateString(Translations $translations): string
4545
$messages[$originalString] = $translation;
4646
}
4747

48-
ksort($messages);
48+
ksort($messages, SORT_STRING);
4949
$numEntries = count($messages);
5050
$originalsTable = '';
5151
$translationsTable = '';

tests/MoGeneratorTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public function testMoGenerator()
3636
$translation->translate('Comentario deshabilitado');
3737
$translations->add($translation);
3838

39+
$translation = Translation::create(null, '15');
40+
$translation->translate('15');
41+
$translations->add($translation);
42+
3943
$translation = Translation::create(null, '123456');
4044
$translation->translate('12345');
4145
$translations->add($translation);
@@ -47,7 +51,7 @@ public function testMoGenerator()
4751

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

50-
$this->assertCount(3, $result);
54+
$this->assertCount(4, $result);
5155
$this->assertCount(5, $result->getHeaders());
5256
}
5357
}

tests/assets/mo-generator-result.mo

22 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)