-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Add more tests around the AMQP transport #27206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Messenger] Add more tests around the AMQP transport #27206
Conversation
092b559
to
022c47f
Compare
022c47f
to
4b8a655
Compare
@@ -34,7 +34,13 @@ public function __construct(EncoderInterface $encoder, DecoderInterface $decoder | ||
|
||
public function createTransport(string $dsn, array $options): TransportInterface | ||
{ | ||
return new AmqpTransport($this->encoder, $this->decoder, $dsn, $options, $this->debug); | ||
return new AmqpTransport( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be in one line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it should
new AmqpTransport($encoder, $decoder, Connection::fromDsn('amqp://localhost', array('foo' => 'bar'), true), array('foo' => 'bar'), true), | ||
$transport | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be on one line
$connection, | ||
$options, | ||
$debug | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one line as well
@@ -22,18 +22,17 @@ class AmqpTransport implements TransportInterface | ||
{ | ||
private $encoder; | ||
private $decoder; | ||
private $dsn; | ||
private $connection; | ||
private $options; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$options and $debug are not used anymore
4b8a655
to
1c0bb0e
Compare
@fabpot @yceruto @ogizanagi good catches, updated. |
use Symfony\Component\Messenger\Transport\Serialization\EncoderInterface; | ||
use Symfony\Component\Messenger\Transport\TransportInterface; | ||
|
||
class AmqpTransportTest extends TestCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should requires amqp extension
1c0bb0e
to
faf9382
Compare
$this->dsn = $dsn; | ||
$this->options = $options; | ||
$this->debug = $debug; | ||
$this->connection = $connection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes laziness. I'd suggest to try harder keeping feature. The factory could validate the dsn itself if that's the goal here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non. The laziness is already within the Connection
object. There is no point of making a class creation lazy 😄 (and even that is already lazy as behind service locators)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it :)
…oze) This PR was merged into the 4.1 branch. Discussion ---------- [Messenger] Add more tests around the AMQP transport | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | ø | License | MIT | Doc PR | ø Adding more tests to the AMQP transport/factory. These should have captured the following 3 bugs: #27198, #27197, #27196. Commits ------- faf9382 Add more tests around the AMQP transport
Adding more tests to the AMQP transport/factory. These should have captured the following 3 bugs: #27198, #27197, #27196.