QueueExceptionTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testQueueExceptionExtendsBaseException() 0 4 1
A testGetQueue() 0 6 1
A testGetMessage() 0 7 1
1
<?php
2
3
/*
4
 * This file is part of the Phive Queue package.
5
 *
6
 * (c) Eugene Leonovich <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Phive\Queue\Tests\Queue;
13
14
use Phive\Queue\QueueException;
15
16
class QueueExceptionTest extends \PHPUnit_Framework_TestCase
17
{
18
    use Util;
19
20
    /**
21
     * @var \Phive\Queue\Queue
22
     */
23
    protected $queue;
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    protected function setUp()
29
    {
30
        $this->queue = $this->getQueueMock();
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->getQueueMock() of type object<PHPUnit_Framework_MockObject_MockObject> is incompatible with the declared type object<Phive\Queue\Queue> of property $queue.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
31
    }
32
33
    public function testQueueExceptionExtendsBaseException()
34
    {
35
        $this->assertInstanceOf('Exception', new QueueException($this->queue));
36
    }
37
38
    public function testGetQueue()
39
    {
40
        $e = new QueueException($this->queue);
41
42
        $this->assertEquals($this->queue, $e->getQueue());
43
    }
44
45
    public function testGetMessage()
46
    {
47
        $message = 'Error message';
48
        $e = new QueueException($this->queue, $message);
49
50
        $this->assertEquals($message, $e->getMessage());
51
    }
52
}
53