| 1 | <?php |
||
| 9 | class ExchangeBindTest extends \PHPUnit_Framework_TestCase |
||
| 10 | { |
||
| 11 | public function testOptions() |
||
| 12 | { |
||
| 13 | $configuration = [ |
||
| 14 | 'exchange' => ['name' => 'foo'], |
||
| 15 | 'routing_keys' => ['routing.1', 'routing.2'], |
||
| 16 | ]; |
||
| 17 | $options = new ExchangeBind(); |
||
| 18 | $options->setFromArray($configuration); |
||
| 19 | |||
| 20 | static::assertInstanceOf('RabbitMqModule\\Options\\Exchange', $options->getExchange()); |
||
| 21 | static::assertCount(2, $options->getRoutingKeys()); |
||
| 22 | static::assertEquals(['routing.1', 'routing.2'], $options->getRoutingKeys()); |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @expectedException \InvalidArgumentException |
||
| 27 | */ |
||
| 28 | public function testSetExchangeInvalidValue() |
||
| 29 | { |
||
| 30 | $options = new ExchangeBind(); |
||
| 31 | $options->setExchange(''); |
||
| 32 | } |
||
| 33 | } |
||
| 34 |