Passed
Pull Request — master (#11)
by Victor
01:49
created

testShouldRenderBaseTemplateWithPlaceholders()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Shoot\Shoot\Tests\Integration\Inheritance;
5
6
use Shoot\Shoot\Tests\Integration\IntegrationTestCase;
7
8
final class InheritanceTest extends IntegrationTestCase
9
{
10
    /** @var string */
11
    protected $templateDirectory = __DIR__ . '/Templates';
12
13
    /**
14
     * @return void
15
     */
16
    public function testShouldRenderBaseTemplateWithPlaceholders()
17
    {
18
        $output = $this->renderTemplate('base.twig');
19
20
        $this->assertContains('<title>base_title</title>', $output);
21
        $this->assertContains('<h1>base_title</h1>', $output);
22
        $this->assertContains('<p>base_footer</p>', $output);
23
    }
24
25
    /**
26
     * @return void
27
     */
28
    public function testShouldRenderChildTemplateWithOverriddenVariables()
29
    {
30
        $output = $this->renderTemplate('page.twig');
31
32
        $this->assertContains('<title>page_title</title>', $output);
33
        $this->assertContains('<h1>page_title</h1>', $output);
34
        $this->assertContains('<p>page_content</p>', $output);
35
        $this->assertContains('<p>base_footer</p>', $output);
36
    }
37
}
38