1 | <?php |
||
9 | class QueueTest extends \PHPUnit_Framework_TestCase |
||
10 | { |
||
11 | public function testOptions() |
||
12 | { |
||
13 | $configuration = [ |
||
14 | 'name' => 'test-name', |
||
15 | 'type' => 'test-type', |
||
16 | 'passive' => true, |
||
17 | 'durable' => true, |
||
18 | 'auto_delete' => false, |
||
19 | 'exclusive' => true, |
||
20 | 'no_wait' => true, |
||
21 | 'ticket' => 1, |
||
22 | 'arguments' => [ |
||
23 | 'argument1' => 'value1', |
||
24 | ], |
||
25 | 'routing_keys' => [ |
||
26 | 'routing1', |
||
27 | 'routing2', |
||
28 | ], |
||
29 | ]; |
||
30 | $options = new Queue(); |
||
31 | $options->setFromArray($configuration); |
||
32 | |||
33 | static::assertEquals($configuration['name'], $options->getName()); |
||
34 | static::assertEquals($configuration['type'], $options->getType()); |
||
35 | static::assertEquals($configuration['passive'], $options->isPassive()); |
||
36 | static::assertEquals($configuration['durable'], $options->isDurable()); |
||
37 | static::assertEquals($configuration['auto_delete'], $options->isAutoDelete()); |
||
38 | static::assertEquals($configuration['exclusive'], $options->isExclusive()); |
||
39 | static::assertEquals($configuration['no_wait'], $options->isNoWait()); |
||
40 | static::assertEquals($configuration['ticket'], $options->getTicket()); |
||
41 | static::assertEquals($configuration['arguments'], $options->getArguments()); |
||
42 | static::assertEquals($configuration['routing_keys'], $options->getRoutingKeys()); |
||
43 | } |
||
44 | } |
||
45 |