DeleteThreadManagerTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 40
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A testInterface() 0 4 1
A testDeleteThread() 0 7 1
1
<?php
2
3
/*
4
 * This file is part of the MilioooMessageBundle package.
5
 *
6
 * (c) Michiel boeckaert <[email protected]>
7
 * This source file is subject to the MIT license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace Miliooo\Messaging\Tests\Manager;
12
13
use Miliooo\Messaging\Manager\DeleteThreadManager;
14
15
/**
16
 * Class DeleteThreadManagerTest
17
 *
18
 * @author Michiel Boeckaert <[email protected]>
19
 */
20
class DeleteThreadManagerTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * The class under test.
24
     *
25
     * @var DeleteThreadManager
26
     */
27
    private $deleteThreadManager;
28
29
    /**
30
     * @var \PHPUnit_Framework_MockObject_MockObject
31
     */
32
    private $threadRepository;
33
34
    /**
35
    * @var \PHPUnit_Framework_MockObject_MockObject
36
    */
37
    private $thread;
38
39
40
    public function setUp()
41
    {
42
        $this->threadRepository = $this->getMock('Miliooo\Messaging\Repository\ThreadRepositoryInterface');
43
        $this->deleteThreadManager = new DeleteThreadManager($this->threadRepository);
44
        $this->thread = $this->getMock('Miliooo\Messaging\Model\ThreadInterface');
45
    }
46
47
    public function testInterface()
48
    {
49
        $this->assertInstanceOf('Miliooo\Messaging\Manager\DeleteThreadManagerInterface', $this->deleteThreadManager);
50
    }
51
52
    public function testDeleteThread()
53
    {
54
        $this->threadRepository->expects($this->once())->method('delete')
55
            ->with($this->thread, true);
56
57
        $this->deleteThreadManager->deleteThread($this->thread, true);
58
    }
59
}
60