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

testTemplateClassCanBeInstanciated()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 0
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