[Web] Update composer libraries

This commit is contained in:
FreddleSpl0it committed 2026-10-28 11:56:29 +01:00
1 parent 9cc8ac2908
commit bd8c784118
1297 files changed
+71585 -24460

No files matched your search

@@ -11,7 +11,10 @@
namespace Symfony\Contracts\Translation\Test;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Translation\TranslatableMessage;
use Symfony\Contracts\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorTrait;
@@ -24,7 +27,7 @@ use Symfony\Contracts\Translation\TranslatorTrait;
*
* As mentioned by chx http://drupal.org/node/1273968 we can cover all by testing number from 0 to 199
*
* The goal to cover all languages is to far fetched so this test case is smaller.
* The goal to cover all languages is too far fetched so this test case is smaller.
*
* @author Clemens Tolboom clemens@build2be.nl
*/
@@ -45,7 +48,7 @@ class TranslatorTest extends TestCase
public function getTranslator(): TranslatorInterface
{
return new class() implements TranslatorInterface {
return new class implements TranslatorInterface {
use TranslatorTrait;
};
}
@@ -53,6 +56,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getTransTests
*/
#[DataProvider('getTransTests')]
public function testTrans($expected, $id, $parameters)
{
$translator = $this->getTranslator();
@@ -63,6 +67,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getTransChoiceTests
*/
#[DataProvider('getTransChoiceTests')]
public function testTransChoiceWithExplicitLocale($expected, $id, $number)
{
$translator = $this->getTranslator();
@@ -75,6 +80,8 @@ class TranslatorTest extends TestCase
*
* @dataProvider getTransChoiceTests
*/
#[DataProvider('getTransChoiceTests')]
#[RequiresPhpExtension('intl')]
public function testTransChoiceWithDefaultLocale($expected, $id, $number)
{
$translator = $this->getTranslator();
@@ -85,6 +92,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getTransChoiceTests
*/
#[DataProvider('getTransChoiceTests')]
public function testTransChoiceWithEnUsPosix($expected, $id, $number)
{
$translator = $this->getTranslator();
@@ -103,6 +111,7 @@ class TranslatorTest extends TestCase
/**
* @requires extension intl
*/
#[RequiresPhpExtension('intl')]
public function testGetLocaleReturnsDefaultLocaleIfNotSet()
{
$translator = $this->getTranslator();
@@ -116,10 +125,12 @@ class TranslatorTest extends TestCase
public static function getTransTests()
{
return [
['Symfony is great!', 'Symfony is great!', []],
['Symfony is awesome!', 'Symfony is %what%!', ['%what%' => 'awesome']],
];
yield ['Symfony is great!', 'Symfony is great!', []];
yield ['Symfony is awesome!', 'Symfony is %what%!', ['%what%' => 'awesome']];
if (class_exists(TranslatableMessage::class)) {
yield ['He said "Symfony is awesome!".', 'He said "%what%".', ['%what%' => new TranslatableMessage('Symfony is %what%!', ['%what%' => 'awesome'])]];
}
}
public static function getTransChoiceTests()
@@ -139,6 +150,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getInterval
*/
#[DataProvider('getInterval')]
public function testInterval($expected, $number, $interval)
{
$translator = $this->getTranslator();
@@ -164,6 +176,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getChooseTests
*/
#[DataProvider('getChooseTests')]
public function testChoose($expected, $id, $number, $locale = null)
{
$translator = $this->getTranslator();
@@ -181,6 +194,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getNonMatchingMessages
*/
#[DataProvider('getNonMatchingMessages')]
public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number)
{
$translator = $this->getTranslator();
@@ -296,6 +310,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider failingLangcodes
*/
#[DataProvider('failingLangcodes')]
public function testFailedLangcodes($nplural, $langCodes)
{
$matrix = $this->generateTestData($langCodes);
@@ -305,6 +320,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider successLangcodes
*/
#[DataProvider('successLangcodes')]
public function testLangcodes($nplural, $langCodes)
{
$matrix = $this->generateTestData($langCodes);
@@ -333,7 +349,7 @@ class TranslatorTest extends TestCase
* This both depends on a complete list trying to add above as understanding
* the plural rules of the current failing languages.
*
* @return array with nplural together with langcodes
* @return array With nplural together with langcodes
*/
public static function failingLangcodes(): array
{
@@ -359,14 +375,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;
}