AMQPMessageTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 58
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testId() 0 8 1
A testIndex() 0 8 1
A testType() 0 8 1
A testData() 0 8 1
1
<?php
2
3
namespace Ajir\RabbitMqSqlBundle\Tests\DataStructure\Message;
4
5
use \PHPUnit_Framework_TestCase as BaseTestCase;
6
use Ajir\RabbitMqSqlBundle\DataStructure\Message\AMQPMessage;
7
8
/**
9
 *
10
 */
11
class AMQPMessageTest extends BaseTestCase
12
{
13
    /**
14
     * Test the $id attribute's accessors
15
     *
16
     * @return void
17
     */
18
    public function testId()
19
    {
20
        $id = rand(1, 999);
21
        $message = new AMQPMessage();
22
        $message->setId($id);
23
24
        $this->assertEquals($id, $message->getId());
25
    }
26
27
    /**
28
     * Test the $index attribute's accessors
29
     *
30
     * @return void
31
     */
32
    public function testIndex()
33
    {
34
        $index = uniqid();
35
        $message = new AMQPMessage();
36
        $message->setIndex($index);
37
38
        $this->assertEquals($index, $message->getIndex());
39
    }
40
41
    /**
42
     * Test the $type attribute's accessors
43
     *
44
     * @return void
45
     */
46
    public function testType()
47
    {
48
        $type = uniqid();
49
        $message = new AMQPMessage();
50
        $message->setType($type);
51
52
        $this->assertEquals($type, $message->getType());
53
    }
54
55
    /**
56
     * Test the $data attribute's accessors
57
     *
58
     * @return void
59
     */
60
    public function testData()
61
    {
62
        $data = uniqid();
63
        $message = new AMQPMessage();
64
        $message->setData($data);
65
66
        $this->assertEquals($data, $message->getData());
67
    }
68
}
69