Failed Conditions
Pull Request — master (#64)
by Chad
03:47
created

QueueAwareTraitTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setQueue() 0 8 1
A getQueue() 0 7 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
        $this->assertAttributeEquals(null, 'mongoQueue', $mockQueue);
0 ignored issues
show
Bug introduced by
The method assertAttributeEquals() does not seem to exist on object<TraderInteractive...go\QueueAwareTraitTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
20
        $mongoQueue = $this->getMockBuilder('\\TraderInteractive\\Mongo\\QueueInterface')->getMock();
21
        $mockQueue->setQueue($mongoQueue);
22
        $this->assertAttributeEquals($mongoQueue, 'mongoQueue', $mockQueue);
0 ignored issues
show
Bug introduced by
The method assertAttributeEquals() does not seem to exist on object<TraderInteractive...go\QueueAwareTraitTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
    }
24
25
    /**
26
     * Verify basic behavior of getQueue().
27
     *
28
     * @test
29
     * @covers \TraderInteractive\Mongo\QueueAwareTrait
30
     *
31
     * @return void
32
     */
33
    public function getQueue()
34
    {
35
        $mockQueue = $this->getObjectForTrait('\TraderInteractive\Mongo\QueueAwareTrait');
36
        $mongoQueue = $this->getMockBuilder('\\TraderInteractive\\Mongo\\QueueInterface')->getMock();
37
        $mockQueue->setQueue($mongoQueue);
38
        $this->assertEquals($mongoQueue, $mockQueue->getQueue());
39
    }
40
}
41