Skip to content

Commit 6bdf7f9

Browse files
Merge branch '5.4' into 6.3
* 5.4: fix test [Validator] added missing Portuguese and Albanian translations
2 parents d55add4 + fa9bf2d commit 6bdf7f9

File tree

6 files changed

+99
-70
lines changed

6 files changed

+99
-70
lines changed

src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
use Symfony\Component\Messenger\MessageBusInterface;
2828
use Symfony\Component\Messenger\RoutableMessageBus;
2929
use Symfony\Component\Messenger\Stamp\BusNameStamp;
30-
use Symfony\Component\Messenger\Tests\ResettableDummyReceiver;
30+
use Symfony\Component\Messenger\Tests\Fixtures\ResettableDummyReceiver;
3131
use Symfony\Component\Messenger\Transport\Receiver\ReceiverInterface;
3232

3333
class ConsumeMessagesCommandTest extends TestCase
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Messenger\Tests\Fixtures;
13+
14+
use Symfony\Component\Messenger\Envelope;
15+
use Symfony\Component\Messenger\Transport\Receiver\ReceiverInterface;
16+
17+
class DummyReceiver implements ReceiverInterface
18+
{
19+
private $deliveriesOfEnvelopes;
20+
private $acknowledgedEnvelopes;
21+
private $acknowledgeCount = 0;
22+
private $rejectCount = 0;
23+
24+
/**
25+
* @param Envelope[][] $deliveriesOfEnvelopes
26+
*/
27+
public function __construct(array $deliveriesOfEnvelopes)
28+
{
29+
$this->deliveriesOfEnvelopes = $deliveriesOfEnvelopes;
30+
}
31+
32+
public function get(): iterable
33+
{
34+
$val = array_shift($this->deliveriesOfEnvelopes);
35+
36+
return $val ?? [];
37+
}
38+
39+
public function ack(Envelope $envelope): void
40+
{
41+
++$this->acknowledgeCount;
42+
$this->acknowledgedEnvelopes[] = $envelope;
43+
}
44+
45+
public function reject(Envelope $envelope): void
46+
{
47+
++$this->rejectCount;
48+
}
49+
50+
public function getAcknowledgeCount(): int
51+
{
52+
return $this->acknowledgeCount;
53+
}
54+
55+
public function getRejectCount(): int
56+
{
57+
return $this->rejectCount;
58+
}
59+
60+
public function getAcknowledgedEnvelopes(): array
61+
{
62+
return $this->acknowledgedEnvelopes;
63+
}
64+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Messenger\Tests\Fixtures;
13+
14+
use Symfony\Contracts\Service\ResetInterface;
15+
16+
class ResettableDummyReceiver extends DummyReceiver implements ResetInterface
17+
{
18+
private $hasBeenReset = false;
19+
20+
public function reset(): void
21+
{
22+
$this->hasBeenReset = true;
23+
}
24+
25+
public function hasBeenReset(): bool
26+
{
27+
return $this->hasBeenReset;
28+
}
29+
}

src/Symfony/Component/Messenger/Tests/WorkerTest.php

Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
use Symfony\Component\Messenger\Stamp\SentStamp;
4242
use Symfony\Component\Messenger\Stamp\StampInterface;
4343
use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage;
44+
use Symfony\Component\Messenger\Tests\Fixtures\DummyReceiver;
45+
use Symfony\Component\Messenger\Tests\Fixtures\ResettableDummyReceiver;
4446
use Symfony\Component\Messenger\Transport\Receiver\QueueReceiverInterface;
4547
use Symfony\Component\Messenger\Transport\Receiver\ReceiverInterface;
4648
use Symfony\Component\Messenger\Worker;
@@ -580,57 +582,6 @@ public function testFlushBatchOnStop()
580582
}
581583
}
582584

583-
class DummyReceiver implements ReceiverInterface
584-
{
585-
private $deliveriesOfEnvelopes;
586-
private $acknowledgedEnvelopes;
587-
private $rejectedEnvelopes;
588-
private $acknowledgeCount = 0;
589-
private $rejectCount = 0;
590-
591-
/**
592-
* @param Envelope[][] $deliveriesOfEnvelopes
593-
*/
594-
public function __construct(array $deliveriesOfEnvelopes)
595-
{
596-
$this->deliveriesOfEnvelopes = $deliveriesOfEnvelopes;
597-
}
598-
599-
public function get(): iterable
600-
{
601-
$val = array_shift($this->deliveriesOfEnvelopes);
602-
603-
return $val ?? [];
604-
}
605-
606-
public function ack(Envelope $envelope): void
607-
{
608-
++$this->acknowledgeCount;
609-
$this->acknowledgedEnvelopes[] = $envelope;
610-
}
611-
612-
public function reject(Envelope $envelope): void
613-
{
614-
++$this->rejectCount;
615-
$this->rejectedEnvelopes[] = $envelope;
616-
}
617-
618-
public function getAcknowledgeCount(): int
619-
{
620-
return $this->acknowledgeCount;
621-
}
622-
623-
public function getRejectCount(): int
624-
{
625-
return $this->rejectCount;
626-
}
627-
628-
public function getAcknowledgedEnvelopes(): array
629-
{
630-
return $this->acknowledgedEnvelopes;
631-
}
632-
}
633-
634585
class DummyQueueReceiver extends DummyReceiver implements QueueReceiverInterface
635586
{
636587
public function getFromQueues(array $queueNames): iterable
@@ -664,18 +615,3 @@ private function process(array $jobs): void
664615
}
665616
}
666617
}
667-
668-
class ResettableDummyReceiver extends DummyReceiver implements ResetInterface
669-
{
670-
private $hasBeenReset = false;
671-
672-
public function reset(): void
673-
{
674-
$this->hasBeenReset = true;
675-
}
676-
677-
public function hasBeenReset(): bool
678-
{
679-
return $this->hasBeenReset;
680-
}
681-
}

src/Symfony/Component/Validator/Resources/translations/validators.pt.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@
436436
</trans-unit>
437437
<trans-unit id="112">
438438
<source>This value is not a valid MAC address.</source>
439-
<target state="needs-review-translation">Este valor não é um endereço MAC válido.</target>
439+
<target>Este valor não é um endereço MAC válido.</target>
440440
</trans-unit>
441441
</body>
442442
</file>

src/Symfony/Component/Validator/Resources/translations/validators.sq.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,11 +432,11 @@
432432
</trans-unit>
433433
<trans-unit id="111">
434434
<source>The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}.</source>
435-
<target state="needs-review-translation">Kodimi i karakterevezbuluar është i pavlefshëm ({{ detected }}). Kodimet e lejuara janë {{ encodings }}.</target>
435+
<target>Kodimi i karakteritidentifikuar është i pavlefshëm ({{ detected }}). Kodimet e lejuara janë {{ encodings }}.</target>
436436
</trans-unit>
437437
<trans-unit id="112">
438438
<source>This value is not a valid MAC address.</source>
439-
<target state="needs-review-translation">Kjo vlerë nuk është një adresë MAC e vlefshme.</target>
439+
<target>Kjo nuk është një adresë e vlefshme e Kontrollit të Qasjes në Media (MAC).</target>
440440
</trans-unit>
441441
</body>
442442
</file>

0 commit comments

Comments
 (0)