package and depencies
This commit is contained in:
@@ -43,10 +43,7 @@ class TranslatorTest extends TestCase
|
||||
\Locale::setDefault($this->defaultLocale);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TranslatorInterface
|
||||
*/
|
||||
public function getTranslator()
|
||||
public function getTranslator(): TranslatorInterface
|
||||
{
|
||||
return new class() implements TranslatorInterface {
|
||||
use TranslatorTrait;
|
||||
@@ -274,7 +271,7 @@ class TranslatorTest extends TestCase
|
||||
['This is a text with a\nnew-line in it. Selector = 0.', '{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.', 0],
|
||||
// with double-quotes and id split accros lines
|
||||
["This is a text with a\nnew-line in it. Selector = 1.", "{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.", 1],
|
||||
// esacape pipe
|
||||
// escape pipe
|
||||
['This is a text with | in it. Selector = 0.', '{0}This is a text with || in it. Selector = 0.|{1}This is a text with || in it. Selector = 1.', 0],
|
||||
// Empty plural set (2 plural forms) from a .PO file
|
||||
['', '|', 1],
|
||||
@@ -317,10 +314,8 @@ class TranslatorTest extends TestCase
|
||||
* This array should contain all currently known langcodes.
|
||||
*
|
||||
* As it is impossible to have this ever complete we should try as hard as possible to have it almost complete.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function successLangcodes()
|
||||
public function successLangcodes(): array
|
||||
{
|
||||
return [
|
||||
['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']],
|
||||
@@ -339,7 +334,7 @@ class TranslatorTest extends TestCase
|
||||
*
|
||||
* @return array with nplural together with langcodes
|
||||
*/
|
||||
public function failingLangcodes()
|
||||
public function failingLangcodes(): array
|
||||
{
|
||||
return [
|
||||
['1', ['fa']],
|
||||
@@ -353,11 +348,10 @@ class TranslatorTest extends TestCase
|
||||
/**
|
||||
* We validate only on the plural coverage. Thus the real rules is not tested.
|
||||
*
|
||||
* @param string $nplural Plural expected
|
||||
* @param array $matrix Containing langcodes and their plural index values
|
||||
* @param bool $expectSuccess
|
||||
* @param string $nplural Plural expected
|
||||
* @param array $matrix Containing langcodes and their plural index values
|
||||
*/
|
||||
protected function validateMatrix($nplural, $matrix, $expectSuccess = true)
|
||||
protected function validateMatrix(string $nplural, array $matrix, bool $expectSuccess = true)
|
||||
{
|
||||
foreach ($matrix as $langCode => $data) {
|
||||
$indexes = array_flip($data);
|
||||
|
Reference in New Issue
Block a user