Add support of variables in layout
Add unit tests associated git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1801 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
56
Tests/outputhtmlTest.php
Normal file
56
Tests/outputhtmlTest.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/** DomFramework - Tests
|
||||
@package domframework
|
||||
@author Dominique Fournier <dominique@fournier38.fr> */
|
||||
|
||||
/** Test the outputhtml.php file */
|
||||
class test_outputhtml extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/** Entry null */
|
||||
public function testlayout1 ()
|
||||
{
|
||||
$this->expectOutputString("");
|
||||
$output = new outputhtml ();
|
||||
print ($output->out (""));
|
||||
}
|
||||
|
||||
public function testlayout2 ()
|
||||
{
|
||||
$this->expectOutputString("data");
|
||||
$output = new outputhtml ();
|
||||
print ($output->out ("data"));
|
||||
}
|
||||
|
||||
public function testlayout3 ()
|
||||
{
|
||||
$this->expectOutputString("data");
|
||||
$output = new outputhtml ();
|
||||
print ($output->out ("data", "title"));
|
||||
}
|
||||
|
||||
public function testlayout4 ()
|
||||
{
|
||||
$this->expectOutputString("<html>
|
||||
<body>
|
||||
Text
|
||||
|
||||
</body>
|
||||
</html>\n");
|
||||
$output = new outputhtml ();
|
||||
print ($output->out ("data", "title", FALSE, FALSE, "Tests/layout.html" ));
|
||||
}
|
||||
|
||||
public function testlayout5 ()
|
||||
{
|
||||
$this->expectOutputString("<html>
|
||||
<body>
|
||||
Text
|
||||
VARIABLE
|
||||
</body>
|
||||
</html>\n");
|
||||
$output = new outputhtml ();
|
||||
$variable = array ("var"=>"VARIABLE");
|
||||
print ($output->out ("data", "title", FALSE, FALSE, "Tests/layout.html",
|
||||
null, $variable));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user