Completed
Push — master ( 8c0a67...1fafee )
by Grégoire
9s
created

GalleryAdminTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 13 1
A testItIsInstantiable() 0 4 1
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\MediaBundle\Tests\Admin;
13
14
use Sonata\MediaBundle\Admin\GalleryAdmin;
15
16
class GalleryAdminTest extends \PHPUnit_Framework_TestCase
17
{
18
    protected $pool;
19
    protected $categoryManager;
20
    protected $mediaAdmin;
21
22
    protected function setUp()
23
    {
24
        $this->pool = $this->prophesize('Sonata\MediaBundle\Provider\Pool');
25
        $this->categoryManager = $this->prophesize('Sonata\ClassificationBundle\Entity\CategoryManager');
26
27
        $this->mediaAdmin = new GalleryAdmin(
28
            null,
29
            'Sonata\MediaBundle\Entity\BaseGallery',
30
            'SonataMediaBundle:GalleryAdmin',
31
            $this->pool->reveal(),
32
            $this->categoryManager->reveal()
0 ignored issues
show
Unused Code introduced by
The call to GalleryAdmin::__construct() has too many arguments starting with $this->categoryManager->reveal().

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...
33
        );
34
    }
35
36
    public function testItIsInstantiable()
37
    {
38
        $this->assertNotNull($this->mediaAdmin);
39
    }
40
}
41