Updates to vendors etc

This commit is contained in:
Chris Hunt
2025-07-11 15:57:48 +01:00
parent d972cbcd0a
commit 8fb6438254
8043 changed files with 248005 additions and 189479 deletions

View File

@@ -11,6 +11,8 @@
namespace Symfony\Contracts\Translation\Test;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Contracts\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorTrait;
@@ -45,7 +47,7 @@ class TranslatorTest extends TestCase
public function getTranslator(): TranslatorInterface
{
return new class() implements TranslatorInterface {
return new class implements TranslatorInterface {
use TranslatorTrait;
};
}
@@ -53,6 +55,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getTransTests
*/
#[DataProvider('getTransTests')]
public function testTrans($expected, $id, $parameters)
{
$translator = $this->getTranslator();
@@ -63,6 +66,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getTransChoiceTests
*/
#[DataProvider('getTransChoiceTests')]
public function testTransChoiceWithExplicitLocale($expected, $id, $number)
{
$translator = $this->getTranslator();
@@ -75,6 +79,8 @@ class TranslatorTest extends TestCase
*
* @dataProvider getTransChoiceTests
*/
#[DataProvider('getTransChoiceTests')]
#[RequiresPhpExtension('intl')]
public function testTransChoiceWithDefaultLocale($expected, $id, $number)
{
$translator = $this->getTranslator();
@@ -85,6 +91,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getTransChoiceTests
*/
#[DataProvider('getTransChoiceTests')]
public function testTransChoiceWithEnUsPosix($expected, $id, $number)
{
$translator = $this->getTranslator();
@@ -103,6 +110,7 @@ class TranslatorTest extends TestCase
/**
* @requires extension intl
*/
#[RequiresPhpExtension('intl')]
public function testGetLocaleReturnsDefaultLocaleIfNotSet()
{
$translator = $this->getTranslator();
@@ -139,6 +147,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getInterval
*/
#[DataProvider('getInterval')]
public function testInterval($expected, $number, $interval)
{
$translator = $this->getTranslator();
@@ -164,6 +173,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getChooseTests
*/
#[DataProvider('getChooseTests')]
public function testChoose($expected, $id, $number, $locale = null)
{
$translator = $this->getTranslator();
@@ -181,6 +191,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getNonMatchingMessages
*/
#[DataProvider('getNonMatchingMessages')]
public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number)
{
$translator = $this->getTranslator();
@@ -296,6 +307,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider failingLangcodes
*/
#[DataProvider('failingLangcodes')]
public function testFailedLangcodes($nplural, $langCodes)
{
$matrix = $this->generateTestData($langCodes);
@@ -305,6 +317,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider successLangcodes
*/
#[DataProvider('successLangcodes')]
public function testLangcodes($nplural, $langCodes)
{
$matrix = $this->generateTestData($langCodes);
@@ -359,14 +372,14 @@ class TranslatorTest extends TestCase
if ($expectSuccess) {
$this->assertCount($nplural, $indexes, "Langcode '$langCode' has '$nplural' plural forms.");
} else {
$this->assertNotEquals((int) $nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms.");
$this->assertNotCount($nplural, $indexes, "Langcode '$langCode' has '$nplural' plural forms.");
}
}
}
protected function generateTestData($langCodes)
{
$translator = new class() {
$translator = new class {
use TranslatorTrait {
getPluralizationRule as public;
}