AdminListBlockServiceTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 8 1
A testDefaultSettings() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\AdminBundle\Tests\Block;
15
16
use Sonata\AdminBundle\Admin\Pool;
17
use Sonata\AdminBundle\Block\AdminListBlockService;
18
use Sonata\AdminBundle\Templating\TemplateRegistryInterface;
19
use Sonata\BlockBundle\Test\BlockServiceTestCase;
20
21
/**
22
 * @author Sullivan Senechal <[email protected]>
23
 */
24
class AdminListBlockServiceTest extends BlockServiceTestCase
25
{
26
    /**
27
     * @var Pool
28
     */
29
    private $pool;
30
31
    /**
32
     * @var TemplateRegistryInterface
33
     */
34
    private $templateRegistry;
35
36
    protected function setUp(): void
37
    {
38
        parent::setUp();
39
40
        $this->pool = $this->createMock(Pool::class);
41
42
        $this->templateRegistry = $this->prophesize(TemplateRegistryInterface::class);
43
    }
44
45
    public function testDefaultSettings(): void
46
    {
47
        $blockService = new AdminListBlockService($this->twig, $this->pool, $this->templateRegistry->reveal());
0 ignored issues
show
Bug introduced by
The method reveal() does not seem to exist on object<Sonata\AdminBundl...plateRegistryInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
48
        $blockContext = $this->getBlockContext($blockService);
49
50
        $this->assertSettings([
51
            'groups' => false,
52
        ], $blockContext);
53
    }
54
}
55