Completed
Pull Request — master (#60)
by Chad
01:24
created

QueueAwareTraitTest::setQueue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
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);
20
        $mongoQueue = $this->getMockBuilder('\\TraderInteractive\\Mongo\\QueueInterface')->getMock();
21
        $mockQueue->setQueue($mongoQueue);
22
        $this->assertAttributeEquals($mongoQueue, 'mongoQueue', $mockQueue);
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