diff --git a/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportFactoryTest.php b/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportFactoryTest.php index adb089efaa533..d29ab10639da2 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportFactoryTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportFactoryTest.php @@ -13,6 +13,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Envelope; +use Symfony\Component\Messenger\Stamp\TransportMessageIdStamp; use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage; use Symfony\Component\Messenger\Transport\InMemoryTransport; use Symfony\Component\Messenger\Transport\InMemoryTransportFactory; @@ -61,7 +62,7 @@ public function testCreateTransportWithoutSerializer() $message = Envelope::wrap(new DummyMessage('Hello.')); $transport->send($message); - $this->assertSame([$message], $transport->get()); + $this->assertEquals([$message->with(new TransportMessageIdStamp(1))], $transport->get()); } public function testCreateTransportWithSerializer() @@ -72,7 +73,7 @@ public function testCreateTransportWithSerializer() $serializer ->expects($this->once()) ->method('encode') - ->with($this->equalTo($message)) + ->with($this->equalTo($message->with(new TransportMessageIdStamp(1)))) ; $transport = $this->factory->createTransport('in-memory://?serialize=true', [], $serializer); $transport->send($message); diff --git a/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportTest.php b/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportTest.php index 0a77bca1179de..1b10a6165823a 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportTest.php @@ -13,6 +13,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Envelope; +use Symfony\Component\Messenger\Stamp\TransportMessageIdStamp; use Symfony\Component\Messenger\Tests\Fixtures\AnEnvelopeStamp; use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage; use Symfony\Component\Messenger\Transport\InMemoryTransport; @@ -49,7 +50,7 @@ public function testSend() { $envelope = new Envelope(new \stdClass()); $this->transport->send($envelope); - $this->assertSame([$envelope], $this->transport->getSent()); + $this->assertEquals([$envelope->with(new TransportMessageIdStamp(1))], $this->transport->getSent()); } public function testSendWithSerialization() @@ -58,7 +59,7 @@ public function testSendWithSerialization() $envelopeDecoded = Envelope::wrap(new DummyMessage('Hello.')); $this->serializer ->method('encode') - ->with($this->equalTo($envelope)) + ->with($this->equalTo($envelope->with(new TransportMessageIdStamp(1)))) ->willReturn(['foo' => 'ba']) ; $this->serializer @@ -89,7 +90,7 @@ public function testQueueWithSerialization() $envelopeDecoded = Envelope::wrap(new DummyMessage('Hello.')); $this->serializer ->method('encode') - ->with($this->equalTo($envelope)) + ->with($this->equalTo($envelope->with(new TransportMessageIdStamp(1)))) ->willReturn(['foo' => 'ba']) ; $this->serializer @@ -128,7 +129,7 @@ public function testAckWithSerialization() $envelopeDecoded = Envelope::wrap(new DummyMessage('Hello.')); $this->serializer ->method('encode') - ->with($this->equalTo($envelope)) + ->with($this->equalTo($envelope->with(new TransportMessageIdStamp(1)))) ->willReturn(['foo' => 'ba']) ; $this->serializer @@ -136,7 +137,7 @@ public function testAckWithSerialization() ->with(['foo' => 'ba']) ->willReturn($envelopeDecoded) ; - $this->serializeTransport->ack($envelope); + $this->serializeTransport->ack($envelope->with(new TransportMessageIdStamp(1))); $this->assertSame([$envelopeDecoded], $this->serializeTransport->getAcknowledged()); } @@ -154,7 +155,7 @@ public function testRejectWithSerialization() $envelopeDecoded = Envelope::wrap(new DummyMessage('Hello.')); $this->serializer ->method('encode') - ->with($this->equalTo($envelope)) + ->with($this->equalTo($envelope->with(new TransportMessageIdStamp(1)))) ->willReturn(['foo' => 'ba']) ; $this->serializer @@ -162,7 +163,7 @@ public function testRejectWithSerialization() ->with(['foo' => 'ba']) ->willReturn($envelopeDecoded) ; - $this->serializeTransport->reject($envelope); + $this->serializeTransport->reject($envelope->with(new TransportMessageIdStamp(1))); $this->assertSame([$envelopeDecoded], $this->serializeTransport->getRejected()); }
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: