From: Greg Beaver Date: Sat, 29 Nov 2003 19:39:51 +0000 (+0000) Subject: start on a new unit test X-Git-Tag: php-5.0.0b3RC1~512 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=595b433b25d6176109892b790ddaf209598696e6;p=php start on a new unit test --- diff --git a/pear/tests/pear_common_infoFromString.phpt b/pear/tests/pear_common_infoFromString.phpt new file mode 100644 index 0000000000..0afc60a5ee --- /dev/null +++ b/pear/tests/pear_common_infoFromString.phpt @@ -0,0 +1,66 @@ +--TEST-- +PEAR_Common::analyzeSourceCode test +--SKIPIF-- + +--FILE-- +getMessage() . "\n"; +} + +echo "Test invalid XML\n"; + +$common->infoFromString('\\goober'); + +echo "Test valid XML, not a package.xml\n"; + +$common->infoFromString('' . + "\n"); + +echo "Test valid package.xml, invalid version number\n"; + +$common->infoFromString('' . + ''); + +echo "Test empty package.xml\n"; + +$ret = $common->infoFromString('' . + ''); + +var_dump($ret); + +?> +--GET-- +--POST-- +--EXPECT-- +Test invalid XML +Caught error: XML error: not well-formed (invalid token) at line 1 +Test valid XML, not a package.xml +Caught error: Invalid Package File, no tag +Test valid package.xml, invalid version number +Caught error: No handlers for package.xml version 10000000 +Test empty package.xml +array(2) { + ["provides"]=> + array(0) { + } + ["filelist"]=> + &array(0) { + } +} \ No newline at end of file