outputhtml : display the result, not return it ! (and adapt the unit tests accordinally)
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2372 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -11,21 +11,21 @@ class test_outputhtml extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
$output = new outputhtml ();
|
||||
$res = $output->out ("");
|
||||
$this->assertNotContains ("{content}", $res);
|
||||
$this->expectOutputRegex ("#<body>\s+</body>#", $res);
|
||||
}
|
||||
|
||||
public function testlayout2 ()
|
||||
{
|
||||
$output = new outputhtml ();
|
||||
$res = $output->out ("data");
|
||||
$this->assertContains("data", $res);
|
||||
$this->expectOutputRegex("#data#");
|
||||
}
|
||||
|
||||
public function testlayout3 ()
|
||||
{
|
||||
$output = new outputhtml ();
|
||||
$res = $output->out ("data", "title");
|
||||
$this->assertContains("data", $res);
|
||||
$this->expectOutputRegex("#data#");
|
||||
}
|
||||
|
||||
public function testlayout4 ()
|
||||
@@ -37,7 +37,7 @@ class test_outputhtml extends PHPUnit_Framework_TestCase
|
||||
</body>
|
||||
</html>\n");
|
||||
$output = new outputhtml ();
|
||||
print ($output->out ("data", "title", FALSE, FALSE, "Tests/layout.html" ));
|
||||
$output->out ("data", "title", FALSE, FALSE, "Tests/layout.html" );
|
||||
}
|
||||
|
||||
public function testlayout5 ()
|
||||
@@ -50,7 +50,7 @@ class test_outputhtml extends PHPUnit_Framework_TestCase
|
||||
</html>\n");
|
||||
$output = new outputhtml ();
|
||||
$variable = array ("var"=>"VARIABLE");
|
||||
print ($output->out ("data", "title", FALSE, FALSE, "Tests/layout.html",
|
||||
null, $variable));
|
||||
$output->out ("data", "title", FALSE, FALSE, "Tests/layout.html",
|
||||
null, $variable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ EOT;
|
||||
foreach ($replacement as $key=>$val)
|
||||
$resView = str_replace ($key, $val, $resView);
|
||||
|
||||
return $resView;
|
||||
echo $resView;
|
||||
}
|
||||
|
||||
/** Get the layout and provide it the variables. The variables will be push in
|
||||
|
||||
Reference in New Issue
Block a user