Passed
Push — master ( 45ab73...eabe48 )
by Victor
45s queued 10s
created

InheritanceTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
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
    protected function setUp(): void
11
    {
12
        $this->setTemplateDirectory(__DIR__ . '/Templates');
13
14
        parent::setUp();
15
    }
16
17
    public function testShouldRenderBaseTemplateWithPlaceholders(): void
18
    {
19
        $output = $this->renderTemplate('base.twig');
20
21
        $this->assertContains('<title>base_title</title>', $output);
22
        $this->assertContains('<h1>base_title</h1>', $output);
23
        $this->assertContains('<p>base_footer</p>', $output);
24
    }
25
26
    public function testShouldRenderChildTemplateWithOverriddenVariables(): void
27
    {
28
        $output = $this->renderTemplate('page.twig');
29
30
        $this->assertContains('<title>page_title</title>', $output);
31
        $this->assertContains('<h1>page_title</h1>', $output);
32
        $this->assertContains('<p>page_content</p>', $output);
33
        $this->assertContains('<p>base_footer</p>', $output);
34
    }
35
}
36