cvs: php-src /pear/tests pear_installer2.phpt

From: Date: Sun, 14 Sep 2003 19:59:06 +0000
Subject: cvs: php-src /pear/tests pear_installer2.phpt
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-12732@lists.php.net to get a copy of this message
cellog Sun Sep 14 15:59:06 2003 EDT Modified files: /php-src/pear/tests pear_installer2.phpt Log: adding test for invalid role Index: php-src/pear/tests/pear_installer2.phpt diff -u php-src/pear/tests/pear_installer2.phpt:1.2 php-src/pear/tests/pear_installer2.phpt:1.3 --- php-src/pear/tests/pear_installer2.phpt:1.2 Sun Sep 14 15:53:37 2003 +++ php-src/pear/tests/pear_installer2.phpt Sun Sep 14 15:59:06 2003 @@ -114,6 +114,17 @@ $installer->rollbackFileTransaction(); +echo "install as invalid role=\"klingon\":\n"; +$err = $installer->_installFile('installer2.phpt.testfile.php', array('role' => 'klingon'), + $temp_path . DIRECTORY_SEPARATOR . 'tmp', array()); +echo 'returned PEAR_Error: ' . (get_class($err) == 'pear_error' ? "yes\n" : "no\n"); +if (is_object($err)) { + echo 'message: ' . $err->getMessage() . "\n"; +} +echo 'file bin/.tmpinstaller2.phpt.testfile.php exists? => '; +echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . + '.tmpinstaller2.phpt.testfile.php') ? "yes\n" : "no\n"); + define('PEARINSTALLERTEST2_FAKE_FOO_CONST', 'good'); echo "\ntest replacements:\n"; $fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'installer2.phpt.testfile.php', 'w'); @@ -205,6 +216,10 @@ install as role="script": int(1) file bin/.tmpinstaller2.phpt.testfile.php exists? => yes +install as invalid role="klingon": +returned PEAR_Error: yes +message: Invalid role `klingon' for file installer2.phpt.testfile.php +file bin/.tmpinstaller2.phpt.testfile.php exists? => no test replacements: int(1)

« previous php.pear.cvs (#12732) next »