QueueAwareTraitTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
c 0
b 0
f 0
dl 0
loc 32
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setQueue() 0 6 1
A getQueue() 0 6 1
1
<?php
2
namespace TraderInteractiveTest\Mongo;
3
4
use PHPUnit\Framework\TestCase;
5
6
class QueueAwareTraitTest extends TestCase
7
{
8
    /**
9
     * Verify basic behavior of setQueue().
10
     *
11
     * @test
12
     * @covers \TraderInteractive\Mongo\QueueAwareTrait
13
     *
14
     * @return void
15
     */
16
    public function setQueue()
17
    {
18
        $mockQueue = $this->getObjectForTrait('\TraderInteractive\Mongo\QueueAwareTrait');
19
        $mongoQueue = $this->getMockBuilder('\\TraderInteractive\\Mongo\\QueueInterface')->getMock();
20
        $mockQueue->setQueue($mongoQueue);
21
        $this->assertEquals($mongoQueue, $mockQueue->getQueue());
22
    }
23
24
    /**
25
     * Verify basic behavior of getQueue().
26
     *
27
     * @test
28
     * @covers \TraderInteractive\Mongo\QueueAwareTrait
29
     *
30
     * @return void
31
     */
32
    public function getQueue()
33
    {
34
        $mockQueue = $this->getObjectForTrait('\TraderInteractive\Mongo\QueueAwareTrait');
35
        $mongoQueue = $this->getMockBuilder('\\TraderInteractive\\Mongo\\QueueInterface')->getMock();
36
        $mockQueue->setQueue($mongoQueue);
37
        $this->assertEquals($mongoQueue, $mockQueue->getQueue());
38
    }
39
}
40