-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #30913 [Messenger] Uses an
AmqpStamp
to provide flags and a…
…ttributes (sroze) This PR was merged into the 4.3-dev branch. Discussion ---------- [Messenger] Uses an `AmqpStamp` to provide flags and attributes | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #28885 | License | MIT | Doc PR | ø Using the `AmqpStamp` you can configure the flags and any attribute (such as `delivery_mode`). Commits ------- 56fa574 Uses an `AmqpStamp` to provide flags and attributes
- Loading branch information
Showing
8 changed files
with
113 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpRoutingKeyStampTest.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpStampTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Messenger\Tests\Transport\AmqpExt; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\Messenger\Transport\AmqpExt\AmqpStamp; | ||
|
||
/** | ||
* @requires extension amqp | ||
*/ | ||
class AmqpStampTest extends TestCase | ||
{ | ||
public function testRoutingKeyOnly() | ||
{ | ||
$stamp = new AmqpStamp('routing_key'); | ||
$this->assertSame('routing_key', $stamp->getRoutingKey()); | ||
$this->assertSame(AMQP_NOPARAM, $stamp->getFlags()); | ||
$this->assertSame([], $stamp->getAttributes()); | ||
} | ||
|
||
public function testFlagsAndAttributes() | ||
{ | ||
$stamp = new AmqpStamp(null, AMQP_DURABLE, ['delivery_mode' => 'unknown']); | ||
$this->assertNull($stamp->getRoutingKey()); | ||
$this->assertSame(AMQP_DURABLE, $stamp->getFlags()); | ||
$this->assertSame(['delivery_mode' => 'unknown'], $stamp->getAttributes()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters