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

RpcServerTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
c 1
b 1
f 0
lcom 0
cbo 2
dl 0
loc 36
rs 10
1
<?php
2
3
namespace RabbitMqModule\Options;
4
5
/**
6
 * Class RpcServerTest
7
 * @package RabbitMqModule\Options
8
 */
9
class RpcServerTest extends \PHPUnit_Framework_TestCase
10
{
11
    public function testSetSerializer()
12
    {
13
        $options = new RpcServer();
14
15
        $options->setSerializer('PhpSerialize');
16
        static::assertInstanceOf('Zend\\Serializer\\Adapter\\AdapterInterface', $options->getSerializer());
17
18
        $options->setSerializer(null);
19
        static::assertNull($options->getSerializer());
20
21
        $options->setSerializer(['name' => 'PhpSerialize']);
22
        static::assertInstanceOf('Zend\\Serializer\\Adapter\\AdapterInterface', $options->getSerializer());
23
    }
24
25
    /**
26
     * @expectedException \InvalidArgumentException
27
     */
28
    public function testSetSerializerWithInvalidValue()
29
    {
30
        $options = new RpcServer();
31
32
        $options->setSerializer(true);
33
    }
34
35
    /**
36
     * @expectedException \InvalidArgumentException
37
     */
38
    public function testSetSerializerWithEmptyArray()
39
    {
40
        $options = new RpcServer();
41
42
        $options->setSerializer([]);
43
    }
44
}
45