Completed
Push — ezp_31440 ( 1f3ef2...0d0002 )
by
unknown
13:18
created

QueryRenderingExtensionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getExtensions() 0 19 1
A getFixturesDir() 0 4 1
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace eZ\Publish\Core\MVC\Symfony\Templating\Tests\Twig\Extension;
10
11
use eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\QueryRenderingExtension;
12
use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
13
14
final class QueryRenderingExtensionTest extends FileSystemTwigIntegrationTestCase
15
{
16
    protected function getExtensions(): array
17
    {
18
        $fragmentHandler = $this->createMock(FragmentHandler::class);
19
        $fragmentHandler
0 ignored issues
show
Bug introduced by
The method method() does not seem to exist on object<PHPUnit\Framework\MockObject\MockObject>.

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...
20
            ->method('render')
21
            ->willReturnCallback(static function (...$args): string {
22
                return var_export($args, true);
23
            });
24
25
        $controllerMap = [
26
            'content' => 'ez_query_render::renderContentQueryAction',
27
            'content_info' => 'ez_query_render::renderContentInfoQueryAction',
28
            'location' => 'ez_query_render::renderLocationQueryAction',
29
        ];
30
31
        return [
32
            new QueryRenderingExtension($fragmentHandler, $controllerMap),
33
        ];
34
    }
35
36
    protected function getFixturesDir(): string
37
    {
38
        return __DIR__ . '/_fixtures/query_rendering_functions/';
39
    }
40
}
41