@@ 9-40 (lines=32) @@ | ||
6 | use PHPUnit\Framework\TestCase; |
|
7 | use Portiny\RabbitMQ\Exchange\ExchangeBind; |
|
8 | ||
9 | final class ExchangeBindTest extends TestCase |
|
10 | { |
|
11 | /** |
|
12 | * @var ExchangeBind |
|
13 | */ |
|
14 | private $exchangeBind; |
|
15 | ||
16 | protected function setUp(): void |
|
17 | { |
|
18 | $this->exchangeBind = new ExchangeBind('someDestination', 'routingKey', true, ['a' => 1]); |
|
19 | } |
|
20 | ||
21 | public function testGetDestination(): void |
|
22 | { |
|
23 | $this->assertSame('someDestination', $this->exchangeBind->getDestination()); |
|
24 | } |
|
25 | ||
26 | public function testGetRoutingKey(): void |
|
27 | { |
|
28 | $this->assertSame('routingKey', $this->exchangeBind->getRoutingKey()); |
|
29 | } |
|
30 | ||
31 | public function testIsNowait(): void |
|
32 | { |
|
33 | $this->assertTrue($this->exchangeBind->isNowait()); |
|
34 | } |
|
35 | ||
36 | public function testGetArguments(): void |
|
37 | { |
|
38 | $this->assertSame(['a' => 1], $this->exchangeBind->getArguments()); |
|
39 | } |
|
40 | } |
|
41 |
@@ 9-40 (lines=32) @@ | ||
6 | use PHPUnit\Framework\TestCase; |
|
7 | use Portiny\RabbitMQ\Queue\QueueBind; |
|
8 | ||
9 | final class QueueBindTest extends TestCase |
|
10 | { |
|
11 | /** |
|
12 | * @var QueueBind |
|
13 | */ |
|
14 | private $queueBind; |
|
15 | ||
16 | protected function setUp(): void |
|
17 | { |
|
18 | $this->queueBind = new QueueBind('someExchange', 'routingKey', true, ['b' => 2]); |
|
19 | } |
|
20 | ||
21 | public function testGetExchange(): void |
|
22 | { |
|
23 | $this->assertSame('someExchange', $this->queueBind->getExchange()); |
|
24 | } |
|
25 | ||
26 | public function testGetRoutingKey(): void |
|
27 | { |
|
28 | $this->assertSame('routingKey', $this->queueBind->getRoutingKey()); |
|
29 | } |
|
30 | ||
31 | public function testIsNowait(): void |
|
32 | { |
|
33 | $this->assertTrue($this->queueBind->isNowait()); |
|
34 | } |
|
35 | ||
36 | public function testGetArguments(): void |
|
37 | { |
|
38 | $this->assertSame(['b' => 2], $this->queueBind->getArguments()); |
|
39 | } |
|
40 | } |
|
41 |