WorkerQueueBagTest   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 104
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 12
lcom 1
cbo 2
dl 104
loc 104
rs 10
c 0
b 0
f 0

12 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetBasicQos() 6 6 1
A testGetQueueName() 6 6 1
A testGetPassive() 6 6 1
A testGetDurable() 6 6 1
A testGetExclusive() 6 6 1
A testGetAutoDelete() 6 6 1
A testGetNoWait() 6 6 1
A testGetArguments() 6 6 1
A testGetTicket() 6 6 1
A testGetQueueDeclare() 18 18 1
A testGetQueueConsume() 18 18 1
A testGetExchangeDeclare() 6 6 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace  Cmobi\RabbitmqBundle\Worker\Test\Transport\Worker;
4
5
use Cmobi\RabbitmqBundle\Tests\BaseTestCase;
6
use Cmobi\RabbitmqBundle\Transport\Worker\WorkerQueueBag;
7
8 View Code Duplication
class WorkerQueueBagTest extends BaseTestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    public function testGetBasicQos()
11
    {
12
        $queueBag = new WorkerQueueBag('test');
13
14
        $this->assertEquals(1, $queueBag->getBasicQos());
15
    }
16
17
    public function testGetQueueName()
18
    {
19
        $queueBag = new WorkerQueueBag('test');
20
21
        $this->assertEquals('test', $queueBag->getQueue());
22
    }
23
24
    public function testGetPassive()
25
    {
26
        $queueBag = new WorkerQueueBag('test');
27
28
        $this->assertEquals(false, $queueBag->getPassive());
29
    }
30
    public function testGetDurable()
31
    {
32
        $queueBag = new WorkerQueueBag('test');
33
34
        $this->assertEquals(true, $queueBag->getDurable());
35
    }
36
    public function testGetExclusive()
37
    {
38
        $queueBag = new WorkerQueueBag('test');
39
40
        $this->assertEquals(false, $queueBag->getExclusive());
41
    }
42
    public function testGetAutoDelete()
43
    {
44
        $queueBag = new WorkerQueueBag('test');
45
46
        $this->assertEquals(false, $queueBag->getAutoDelete());
47
    }
48
    public function testGetNoWait()
49
    {
50
        $queueBag = new WorkerQueueBag('test');
51
52
        $this->assertEquals(false, $queueBag->getNoWait());
53
    }
54
    public function testGetArguments()
55
    {
56
        $queueBag = new WorkerQueueBag('test');
57
58
        $this->assertEquals(null, $queueBag->getArguments());
59
    }
60
    public function testGetTicket()
61
    {
62
        $queueBag = new WorkerQueueBag('test');
63
64
        $this->assertEquals(null, $queueBag->getTicket());
65
    }
66
67
    public function testGetQueueDeclare()
68
    {
69
        $queueBag = new WorkerQueueBag('test');
70
71
        $this->assertEquals(
72
            [
73
                'test',
74
                false,
75
                true,
76
                false,
77
                false,
78
                false,
79
                null,
80
                null,
81
            ],
82
            $queueBag->getQueueDeclare()
83
        );
84
    }
85
86
    public function testGetQueueConsume()
87
    {
88
        $queueBag = new WorkerQueueBag('test');
89
90
        $this->assertEquals(
91
            [
92
                'test',
93
                '',
94
                false,
95
                false,
96
                false,
97
                false,
98
                null,
99
                null,
100
            ],
101
            $queueBag->getQueueConsume()
102
        );
103
    }
104
105
    public function testGetExchangeDeclare()
106
    {
107
        $queueBag = new WorkerQueueBag('test');
108
109
        $this->assertEquals(false, $queueBag->getExchangeDeclare());
110
    }
111
}
112