Skip to content

Commit c867b9d

Browse files
committed
Require phpmyadmin/motranslator in TranslatorTest
Found wile running the Debian tests without motranslator. I copied the logic we normally use in the main repo. And Translator::load() was missing in the test. Signed-off-by: William Desportes <williamdes@wdes.fr>
1 parent 098cd86 commit c867b9d

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎tests/Misc/TranslatorTest.php‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use ReflectionClass;
1414
use ReflectionProperty;
1515

16+
use function class_exists;
1617
use function realpath;
1718

1819
use const PHP_VERSION_ID;
@@ -21,6 +22,17 @@
2122
#[CoversClass(Translator::class)]
2223
final class TranslatorTest extends TestCase
2324
{
25+
public function setUp(): void
26+
{
27+
parent::setUp();
28+
29+
if (class_exists(Loader::class)) {
30+
return;
31+
}
32+
33+
$this->markTestSkipped('The phpmyadmin/motranslator package is missing.');
34+
}
35+
2436
public static function tearDownAfterClass(): void
2537
{
2638
$loaderProperty = new ReflectionProperty(Translator::class, 'loader');
@@ -123,6 +135,9 @@ public function testGettext(): void
123135

124136
$translatorProperty->setValue(null, null);
125137
Translator::setLocale('pt_BR');
138+
139+
Translator::load();
140+
126141
self::assertSame(
127142
'Início de declaração inesperado.',
128143
Translator::gettext('Unexpected beginning of statement.')

0 commit comments

Comments
 (0)