Skip to content

Commit 6264e9f

Browse files
committed
Merge branch 'onphp-master' into metaPropertyBug
* onphp-master: update doc/ChangeLog for #46 * view test tune * view test initialization fix + add simple view render test Conflicts: doc/ChangeLog
2 parents fdf6e5f + 0e262ae commit 6264e9f

File tree

5 files changed

+47
-0
lines changed

5 files changed

+47
-0
lines changed

doc/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
* meta/types/ObjectType.class.php, test/misc/DAOTest.class.php: changed logic
44
for getObjectId method of lazy encapsulant; test for lazy logic added
55

6+
2011-11-29 Igor V. Gulyaev
7+
8+
* test/main/ViewTest.class.php: added View test
9+
610
2011-11-21 Evgeny V. Kokovikhin
711

812
* core/DB/PostgresDialect.class.php, test/main/PostgresDialectTest.class.php:

test/main/ViewTest.class.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
/***************************************************************************
3+
* Copyright (C) 2011 by Igor V. Gulyaev *
4+
* *
5+
* This program is free software; you can redistribute it and/or modify *
6+
* it under the terms of the GNU Lesser General Public License as *
7+
* published by the Free Software Foundation; either version 3 of the *
8+
* License, or (at your option) any later version. *
9+
* *
10+
***************************************************************************/
11+
12+
final class ViewTest extends TestCase
13+
{
14+
protected static $resolver;
15+
16+
public static function setUpBeforeClass()
17+
{
18+
self::$resolver = new PhpViewResolver(ONPHP_TEST_PATH.'main/data/views/', EXT_TPL);
19+
}
20+
21+
public static function tearDownAfterClass()
22+
{
23+
self::$resolver = NULL;
24+
}
25+
26+
public function testToString()
27+
{
28+
$renderView = self::$resolver->resolveViewName('testView');
29+
$toStringView = self::$resolver->resolveViewName('testViewToString');
30+
31+
$model = Model::create();
32+
33+
$this->assertTrue(
34+
$toStringView->toString($model) == $renderView->toString($model)
35+
);
36+
}
37+
}
38+
?>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PartView
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TestView Begin <?php
2+
$partViewer->view('testPartView')
3+
?> TestViewEnd
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TestView Begin <?=$partViewer->toString('testPartView')?> TestViewEnd

0 commit comments

Comments
 (0)