Completed
Push — 3.x-dev-kit ( 21be5a )
by
unknown
03:10
created

CommentManagerTest::testImplements()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[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 Sonata\NewsBundle\Tests\Document;
13
14
use Sonata\NewsBundle\Document\CommentManager;
15
16
/**
17
 * Class CommentManagerTest.
18
 *
19
 * Tests the comment manager document.
20
 */
21
class CommentManagerTest extends \PHPUnit_Framework_TestCase
22
{
23
    public function testImplements()
24
    {
25
        $registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
26
        $postManager = $this->getMock('Sonata\NewsBundle\Model\PostManagerInterface');
27
28
        $commentManager = new CommentManager('Sonata\NewsBundle\Document\BaseComment', $registry, $postManager);
0 ignored issues
show
Unused Code introduced by
The call to CommentManager::__construct() has too many arguments starting with $postManager.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
29
30
        $this->assertInstanceOf('Sonata\CoreBundle\Model\PageableManagerInterface', $commentManager);
31
    }
32
}
33