<?php declare(strict_types=1);

require_once __DIR__ . '/../../src/common/QrbTranslator.php';

use PHPUnit\Framework\TestCase;

final class QrbTranslatorTest extends TestCase
{
    private const TRANSLATION_DIR = __DIR__ . "/../../translations/";

    private QrbStorage $qrbStorage;
    
    protected function setUp() : void
    {
        $this->qrbStorage = new QrbFileStorage();
    }
    
    protected function tearDown() : void
    {
        $this->qrbStorage->deleteData();
    }

    public function testFindTranslationFiles() : void
    {
        $qrbXl = new QrbTranslator();
        
        $messageFiles = $qrbXl->findTranslationFiles(self::TRANSLATION_DIR);
        
        $this->assertTrue(str_ends_with($messageFiles["de"], "messages.de.php"));
        $this->assertTrue(str_ends_with($messageFiles["en"], "messages.en.php"));
   }
}

?>
