Completed
Pull Request — 2.x (#158)
by Grégoire
03:07
created

TwigTemplateTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testTemplateClassCanBeInstanciated() 0 8 2
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\CacheBundle\Tests\Twig;
13
14
use PHPUnit\Framework\TestCase;
15
use Sonata\CacheBundle\Twig\TwigTemplate13;
16
use Sonata\CacheBundle\Twig\TwigTemplate14;
17
18
class TwigTemplateTest extends TestCase
19
{
20
    public function testTemplateClassCanBeInstanciated()
21
    {
22
        $templateClass = class_exists(\Twig_Node_Body::class) ?
23
            TwigTemplate14::class :
24
            TwigTemplate13::class;
25
        $template = $this->prophesize($templateClass);
26
        $this->assertInstanceOf($templateClass, $template->reveal());
27
    }
28
}
29