forked from php-censor/php-censor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewTest.php
More file actions
32 lines (26 loc) · 738 Bytes
/
Copy pathViewTest.php
File metadata and controls
32 lines (26 loc) · 738 Bytes
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
<?php
namespace Tests\PHPCensor;
use PHPCensor\View;
class ViewTest extends \PHPUnit\Framework\TestCase
{
public function testSimpleView()
{
$view = new View('simple', ROOT_DIR . 'tests/data/View/');
self::assertTrue($view->render() == 'Hello');
}
/**
* @expectedException \Exception
*/
public function testInvalidView()
{
new View('dogs', ROOT_DIR . 'tests/data/View/');
}
public function testViewVars()
{
$view = new View('vars', ROOT_DIR . 'tests/data/View/');
$view->who = 'World';
self::assertTrue(isset($view->who));
self::assertFalse(isset($view->what));
self::assertTrue($view->render() == 'Hello World');
}
}