Fix tests for cli runner.

This commit is contained in:
mark_story 2013-02-28 21:22:01 -05:00
parent b0280b27b1
commit 15d01bf901

View file

@ -853,6 +853,7 @@ EXPECTED;
* @return void
*/
public function testPr() {
$this->skipIf(php_sapi_name() == 'cli', 'Skipping web test in cli mode');
ob_start();
pr('this is a test');
$result = ob_get_clean();
@ -866,6 +867,26 @@ EXPECTED;
$this->assertEquals($expected, $result);
}
/**
* test pr()
*
* @return void
*/
public function testPrCli() {
$this->skipIf(php_sapi_name() != 'cli', 'Skipping cli test in web mode');
ob_start();
pr('this is a test');
$result = ob_get_clean();
$expected = "\nthis is a test\n";
$this->assertEquals($expected, $result);
ob_start();
pr(array('this' => 'is', 'a' => 'test'));
$result = ob_get_clean();
$expected = "\nArray\n(\n [this] => is\n [a] => test\n)\n\n";
$this->assertEquals($expected, $result);
}
/**
* test stripslashes_deep()
*