Completed
Push — master ( be1f89...dd7c75 )
by Artem
13:35
created

ExchangeBindTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
c 1
b 1
f 0
lcom 1
cbo 2
dl 0
loc 25
rs 10
1
<?php
2
3
namespace RabbitMqModule\Options;
4
5
/**
6
 * Class ExchangeBindTest
7
 * @package RabbitMqModule\Options
8
 */
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