git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2845 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
55 lines
1.4 KiB
PHP
55 lines
1.4 KiB
PHP
<?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->expectOutputRegex ("#<body>\s+</body>#");
|
|
$output = new outputhtml ();
|
|
$res = $output->out ("");
|
|
}
|
|
|
|
public function testlayout2 ()
|
|
{
|
|
$this->expectOutputRegex("#data#");
|
|
$output = new outputhtml ();
|
|
$res = $output->out ("data");
|
|
}
|
|
|
|
public function testlayout3 ()
|
|
{
|
|
$this->expectOutputRegex("#data#");
|
|
$output = new outputhtml ();
|
|
$res = $output->out ("data", "title");
|
|
}
|
|
|
|
public function testlayout4 ()
|
|
{
|
|
$this->expectOutputString("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">
|
|
<html><body>
|
|
Text
|
|
|
|
</body></html>\n");
|
|
$output = new outputhtml ();
|
|
$output->out ("data", "title", FALSE, FALSE, "Tests/layout.html" );
|
|
}
|
|
|
|
public function testlayout5 ()
|
|
{
|
|
$this->expectOutputString("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">
|
|
<html><body>
|
|
Text
|
|
VARIABLE
|
|
</body></html>\n");
|
|
$output = new outputhtml ();
|
|
$variable = array ("var"=>"VARIABLE");
|
|
$output->out ("data", "title", FALSE, FALSE, "Tests/layout.html",
|
|
null, $variable);
|
|
}
|
|
}
|