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

QueryRenderingExtensionTest::getExtensions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 19
rs 9.6333
c 0
b 0
f 0
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