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

ModelsTest::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\Models;
5
6
use Shoot\Shoot\Tests\Integration\IntegrationTestCase;
7
8
final class ModelsTest extends IntegrationTestCase
9
{
10
    protected function setUp(): void
11
    {
12
        $this->setTemplateDirectory(__DIR__ . '/Templates');
13
14
        parent::setUp();
15
    }
16
17
    public function testVariablesDefinedInTheModelShouldBeAvailableToTheTemplate(): void
18
    {
19
        $output = $this->renderTemplate('page.twig');
20
21
        $this->assertContains('<h1>page_title</h1>', $output);
22
        $this->assertContains('<p>page_content</p>', $output);
23
    }
24
25
    public function testDefiningMultipleModelsShouldThrowAnException(): void
26
    {
27
        $this->expectExceptionMessage('A presentation model has already been assigned');
28
29
        $this->renderTemplate('page_with_multiple_models.twig');
30
    }
31
}
32