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

ModelsTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 8
dl 0
loc 22
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testVariablesDefinedInTheModelShouldBeAvailableToTheTemplate() 0 6 1
A testDefiningMultipleModelsShouldThrowAnException() 0 5 1
A setUp() 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
    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