forked from TYPO3/Fluid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractViewTest.php
More file actions
48 lines (42 loc) · 1.24 KB
/
AbstractViewTest.php
File metadata and controls
48 lines (42 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
declare(strict_types=1);
namespace TYPO3Fluid\Fluid\Tests\Unit\View;
/*
* This file belongs to the package "TYPO3 Fluid".
* See LICENSE.txt that was shipped with this package.
*/
use TYPO3Fluid\Fluid\Tests\UnitTestCase;
use TYPO3Fluid\Fluid\View\AbstractView;
/**
* Testcase for the AbstractView
*/
class AbstractViewTest extends UnitTestCase
{
/**
* @test
*/
public function testParentRenderMethodReturnsEmptyString(): void
{
$instance = $this->getMockForAbstractClass(AbstractView::class);
$result = $instance->render();
$this->assertEquals('', $result);
}
/**
* @test
*/
public function testAssignsVariableAndReturnsSelf(): void
{
$mock = $this->getMockForAbstractClass(AbstractView::class);
$mock->assign('test', 'foobar');
$this->assertAttributeEquals(['test' => 'foobar'], 'variables', $mock);
}
/**
* @test
*/
public function testAssignsMultipleVariablesAndReturnsSelf(): void
{
$mock = $this->getMockForAbstractClass(AbstractView::class);
$mock->assignMultiple(['test' => 'foobar', 'baz' => 'barfoo']);
$this->assertAttributeEquals(['test' => 'foobar', 'baz' => 'barfoo'], 'variables', $mock);
}
}