QueueExceptionTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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