cvs: pear /Config/test bug3134.phpt
| From: | Adam AShley | Date: | Tue, 03 Jan 2006 04:05:08 +0000 |
| Subject: | cvs: pear /Config/test bug3134.phpt | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-37272@lists.php.net to get a copy of this message | ||
aashley Tue Jan 3 04:05:08 2006 UTC
Added files:
/pear/Config/test bug3134.phpt
Log:
add regression test for bug #3134
http://cvs.php.net/viewcvs.cgi/pear/Config/test/bug3134.phpt?view=markup&rev=1.1
Index: pear/Config/test/bug3134.phpt
+++ pear/Config/test/bug3134.phpt
--TEST--
regression test for bug #3134
--FILE--
<?php
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
$array = array("foo", "bar", "too"); // the source of the config to
write.
$root =& $config->parseConfig($array, "phparray");
if (PEAR::isError($root)) {
die('Error while reading configuration: ' . $root->getMessage() .
"\r\n");
}
$result = $root->createComment("Comment", "before", $root->children[0]);
if (PEAR::isError($result)) {
die('Error while reading configuration: ' . $result->getMessage() .
"\r\n");
}
$exp = '// Comment
$conf[\'0\'] = \'foo\';
$conf[\'1\'] = \'bar\';
$conf[\'2\'] = \'too\';
';
//print_r($root->toString('phparray'));
if ($phpt->assertNoErrors('problem!')) {
$phpt->assertEquals($root->toString('phparray'), $exp, 'uh oh');
}
echo 'tests done';
?>
--EXPECT--
tests done