mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
36 lines
983 B
PHP
36 lines
983 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Flasher\Tests\Prime\Translation;
|
|
|
|
use Flasher\Prime\Translation\Messages;
|
|
use PHPUnit\Framework\Attributes\DataProvider;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
final class MessagesTest extends TestCase
|
|
{
|
|
/**
|
|
* Test 'get' method with provided languages.
|
|
*/
|
|
#[DataProvider('provideLanguages')]
|
|
public function testGet(string $language, bool $empty): void
|
|
{
|
|
$actual = Messages::get($language);
|
|
$this->assertSame($empty, empty($actual));
|
|
}
|
|
|
|
public static function provideLanguages(): \Iterator
|
|
{
|
|
yield 'Arabic' => ['ar', false];
|
|
yield 'German' => ['de', false];
|
|
yield 'English' => ['en', false];
|
|
yield 'Spanish' => ['es', false];
|
|
yield 'French' => ['fr', false];
|
|
yield 'Portuguese' => ['pt', false];
|
|
yield 'Russian' => ['ru', false];
|
|
yield 'Chinese' => ['zh', false];
|
|
yield 'Non-Existing' => ['non-existing', true];
|
|
}
|
|
}
|