Test Failed
Push — master ( 455bd7...69dbbf )
by Jean-Bernard
01:57
created

testReturnsResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Symfony-Util package.
5
 *
6
 * (c) Jean-Bernard Addor
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
use PHPUnit\Framework\TestCase;
13
// use Symfony\Bundle\TwigBundle\TwigEngine;
14
use Symfony\Bridge\Twig\TwigEngine;
15
use Symfony\Component\HttpFoundation\Response;
16
use Symfony\Component\Templating\TemplateNameParser;
17
use SymfonyUtil\Controller\EngineAsArgumentController;
18
19
/**
20
 * @covers \SymfonyUtil\Controller\EngineAsArgumentController
21
 */
22
final class EngineAsArgumentControllerTest extends TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
23
{
24
    public function testCanBeCreated()
25
    {
26
        $this->assertInstanceOf(
27
            EngineAsArgumentController::class,
28
            new EngineAsArgumentController()
29
        );
30
    }
31
32
    public function testReturnsResponse()
33
    {
34
        $this->assertInstanceOf(
35
            Response::class,
36
            (new EngineAsArgumentController())(new TwigEngine(
37
                new Twig_Environment(new Twig_Loader_Array(['index.html.twig' => 'Hello World!'])),
38
                new TemplateNameParser
39
            ))
40
        );
41
    }
42
}
43
44
// http://api.symfony.com/3.3/Symfony/Bundle/TwigBundle/TwigEngine.html
45
// http://api.symfony.com/3.3/Symfony/Bridge/Twig/TwigEngine.html
46