8000 Merge branch '4.4' into 5.2 · symfony/symfony@0cc054c · GitHub
[go: up one dir, main page]

Skip to content

Commit 0cc054c

Browse files
Merge branch '4.4' into 5.2
* 4.4: Fix tests Fix minor typos [WebProfilerBundle] Fix the values of some CSS properties [Yaml] Fixed an exception message Fix ctype_digit deprecation Add a Special Case for Translating Choices in en_US_POSIX
2 parents 8c75b86 + 5e80445 commit 0cc054c

File tree

11 files changed

+34
-19
lines changed

11 files changed

+34
-19
lines changed

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
if: "${{ matrix.php == '8.0' && ! matrix.mode }}"
140140
run: |
141141
sed -i 's/"\*\*\/Tests\/"//' composer.json
142-
composer install --optimize-autoloader
142+
composer install -q --optimize-autoloader
143143
SYMFONY_PATCH_TYPE_DECLARATIONS=force=1 php .github/patch-types.php
144144
SYMFONY_PATCH_TYPE_DECLARATIONS=force=1 php .github/patch-types.php # ensure the script is idempotent
145145
echo PHPUNIT="$PHPUNIT,legacy" >> $GITHUB_ENV

src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function getDescribeCallableTestData()
209209
}
210210

211211
/** @dataProvider getClassDescriptionTestData */
212-
public function testGetClassDecription($object, $expectedDescription)
212+
public function testGetClassDescription($object, $expectedDescription)
213213
{
214214
$this->assertEquals($expectedDescription, $this->getDescriptor()->getClassDescription($object));
215215
}

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.css.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.container {
2-
max-width: auto;
2+
max-width: none;
33
margin: 0;
44
padding: 0;
55
}
@@ -28,5 +28,5 @@
2828
}
2929

3030
.exception-message-wrapper .container {
31-
min-height: auto;
31+
min-height: unset;
3232
}

src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,14 +1033,14 @@ public function testMaxSecondsBetweenRedraws()
10331033
$bar->setRedrawFrequency(4); // disable step based redraws
10341034
$bar->start();
10351035

1036-
$bar->setProgress(1); // No treshold hit, no redraw
1036+
$bar->setProgress(1); // No threshold hit, no redraw
10371037
$bar->maxSecondsBetweenRedraws(2);
10381038
sleep(1);
10391039
$bar->setProgress(2); // Still no redraw because it takes 2 seconds for a redraw
10401040
sleep(1);
10411041
$bar->setProgress(3); // 1+1 = 2 -> redraw finally
10421042
$bar->setProgress(4); // step based redraw freq hit, redraw even without sleep
1043-
$bar->setProgress(5); // No treshold hit, no redraw
1043+
$bar->setProgress(5); // No threshold hit, no redraw
10441044
$bar->maxSecondsBetweenRedraws(3);
10451045
sleep(2);
10461046
$bar->setProgress(6); // No redraw even though 2 seconds passed. Throttling has priority
@@ -1071,7 +1071,7 @@ public function testMinSecondsBetweenRedraws()
10711071
$bar->setProgress(3); // 1 second passed but we changed threshold, should not draw
10721072
sleep(1);
10731073
$bar->setProgress(4); // 1+1 seconds = 2 seconds passed which conforms threshold, draw
1074-
$bar->setProgress(5); // No treshold hit, no redraw
1074+
$bar->setProgress(5); // No threshold hit, no redraw
10751075

10761076
rewind($output->getStream());
10771077
$this->assertEquals(

src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/ConnectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ public function testAmqpStampHeadersAreUsed()
599599
$connection->publish('body', ['Foo' => 'X'], 0, new AmqpStamp(null, \AMQP_NOPARAM, ['headers' => ['Bar' => 'Y']]));
600600
}
601601

602-
public function testAmqpStampDelireryModeIsUsed()
602+
public function testAmqpStampDeliveryModeIsUsed()
603603
{
604604
$factory = new TestAmqpFactory(
605605
$this->createMock(\AMQPConnection::class),

src/Symfony/Component/Messenger/Tests/EventListener/SendFailedMessageForRetryListenerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ public function testEnvelopeKeepOnlyTheLast10Stamps()
177177
$senderLocator = $this->createMock(ContainerInterface::class);
178178
$senderLocator->expects($this->once())->method('has')->willReturn(true);
179179
$senderLocator->expects($this->once())->method('get')->willReturn($sender);
180-
$retryStategy = $this->createMock(RetryStrategyInterface::class);
181-
$retryStategy->expects($this->once())->method('isRetryable')->willReturn(true);
182-
$retryStategy->expects($this->once())->method('getWaitingTime')->willReturn(1000);
180+
$retryStrategy = $this->createMock(RetryStrategyInterface::class);
181+
$retryStrategy->expects($this->once())->method('isRetryable')->willReturn(true);
182+
$retryStrategy->expects($this->once())->method('getWaitingTime')->willReturn(1000);
183183
$retryStrategyLocator = $this->createMock(ContainerInterface::class);
184184
$retryStrategyLocator->expects($this->once())->method('has')->willReturn(true);
185-
$retryStrategyLocator->expects($this->once())->method('get')->willReturn($retryStategy);
185+
$retryStrategyLocator->expects($this->once())->method('get')->willReturn($retryStrategy);
186186

187187
$listener = new SendFailedMessageForRetryListener($senderLocator, $retryStrategyLocator);
188188

src/Symfony/Component/Validator/Tests/Validator/RecursiveValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1988,7 +1988,7 @@ public function testPassConstraintToViolation()
19881988
$this->assertSame($constraint, $violations[0]->getConstraint());
19891989
}
19901990

1991-
public function testCollectionConstraitViolationHasCorrectContext()
1991+
public function testCollectionConstraintViolationHasCorrectContext()
19921992
{
19931993
$data = [
19941994
'foo' => 'fooValue',

src/Symfony/Component/Yaml/Inline.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ public static function dump($value, int $flags = 0): string
161161
return 'true';
162162
case false === $value:
163163
return 'false';
164-
case ctype_digit($value):
165-
return \is_string($value) ? "'$value'" : (int) $value;
164+
case \is_int($value):
165+
return $value;
166166
case is_numeric($value) && false === strpos($value, "\f") && false === strpos($value, "\n") && false === strpos($value, "\r") && false === strpos($value, "\t") && false === strpos($value, "\v"):
167167
$locale = setlocale(\LC_NUMERIC, 0);
168168
if (false !== $locale) {
@@ -729,7 +729,7 @@ private static function parseTag(string $value, int &$i, int $flags): ?string
729729
$nextOffset += strspn($value, ' ', $nextOffset);
730730

731731
if ('' === $tag && (!isset($value[$nextOffset]) || \in_array($value[$nextOffset], [']', '}', ','], true))) {
732-
throw new ParseException(sprintf('Using the unquoted scalar value "!" is not supported. You must quote it.', $value), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
732+
throw new ParseException('Using the unquoted scalar value "!" is not supported. You must quote it.', self::$parsedLineNumber + 1, $value, self::$parsedFilename);
733733
}
734734

735735
// Is followed by a scalar and is a built-in tag

src/Symfony/Contracts/Tests/Service/ServiceSubscriberTraitTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ public function aParentService(): Service1
4242
{
4343
}
4444

45-
public function setContainer(ContainerInterface $container): ContainerInterface
45+
/**
46+
* @return ContainerInterface
47+
*/
48+
public function setContainer(ContainerInterface $container)
4649
{
4750
return $container;
4851
}

src/Symfony/Contracts/Translation/Test/TranslatorTest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ public function testTransChoiceWithDefaultLocale($expected, $id, $number)
83 D1D5 83
$this->assertEquals($expected, $translator->trans($id, ['%count%' => $number]));
8484
}
8585

86+
/**
87+
* @dataProvider getTransChoiceTests
88+
*/
89+
public function testTransChoiceWithEnUsPosix($expected, $id, $number)
90+
{
91+
$translator = $this->getTranslator();
92+
$translator->setLocale('en_US_POSIX');
93+
94+
$this->assertEquals($expected, $translator->trans($id, ['%count%' => $number]));
95+
}
96+
8697
public function testGetSetLocale()
8798
{
8899
$translator = $this->getTranslator();
@@ -311,7 +322,7 @@ public function successLangcodes()
311322
{
312323
return [
313324
['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']],
314-
['2', ['nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM']],
325+
['2', ['nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM', 'en_US_POSIX']],
315326
['3', ['be', 'bs', 'cs', 'hr']],
316327
['4', ['cy', 'mt', 'sl']],
317328
['6', ['ar']],

0 commit comments

Comments
 (0)
0