Passed
Pull Request — master (#11)
by Victor
02:42
created

ModelsTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testVariablesDefinedInTheModelShouldBeAvailableToTheTemplate() 0 6 1
A testDefiningMultipleModelsShouldThrowAnException() 0 5 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Shoot\Shoot\Tests\Integration\Models;
5
6
use Shoot\Shoot\Tests\Integration\IntegrationTestCase;
7
8
final class ModelsTest extends IntegrationTestCase
9
{
10
    /** @var string */
11
    protected $templateDirectory = __DIR__ . '/Templates';
12
13
    /**
14
     * @return void
15
     */
16
    public function testVariablesDefinedInTheModelShouldBeAvailableToTheTemplate()
17
    {
18
        $output = $this->renderTemplate('page.twig');
19
20
        $this->assertContains('<h1>page_title</h1>', $output);
21
        $this->assertContains('<p>page_content</p>', $output);
22
    }
23
24
    /**
25
     * @return void
26
     */
27
    public function testDefiningMultipleModelsShouldThrowAnException()
28
    {
29
        $this->expectExceptionMessage('A presentation model has already been assigned');
30
31
        $this->renderTemplate('page_with_multiple_models.twig');
32
    }
33
}
34