Passed
Push — master ( 20ba69...1ea7e6 )
by Victor
47s queued 11s
created

InheritanceTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 11
dl 0
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testShouldRenderBaseTemplateWithPlaceholders() 0 7 1
A testShouldRenderChildTemplateWithOverriddenVariables() 0 8 1
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