From 8014d0dfac1959f933dd0fa0183ecbf92c381a91 Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Mon, 15 Sep 2003 03:14:12 +0000 Subject: [PATCH] add testing for baseinstalldir attribute --- pear/tests/pear_installer2.phpt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pear/tests/pear_installer2.phpt b/pear/tests/pear_installer2.phpt index 5e86ddf732..83cdecaf6c 100644 --- a/pear/tests/pear_installer2.phpt +++ b/pear/tests/pear_installer2.phpt @@ -232,6 +232,25 @@ if (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . } $installer->rollbackFileTransaction(); +echo "\ntest baseinstalldir:\n"; +var_dump($installer->_installFile('installer2.phpt.testfile.php', array('role' => 'script', + 'baseinstalldir' => 'Foo/Mine'), + $temp_path . DIRECTORY_SEPARATOR . 'tmp', array())); +echo "==>test baseinstalldir = 'Foo/Mine'. file exists? "; +if (file_exists($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . + 'Foo' . DIRECTORY_SEPARATOR . 'Mine' . DIRECTORY_SEPARATOR . '.tmpinstaller2.phpt.testfile.php')) +{ + echo "yes\n"; +} else { + echo "no\n"; +} +$installer->rollbackFileTransaction(); + +rmdir($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . + 'Foo' . DIRECTORY_SEPARATOR . 'Mine'); +rmdir($temp_path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . + 'Foo'); + unlink($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'installer2.phpt.testfile.php'); //cleanup @@ -307,3 +326,7 @@ test install-as: int(1) ==>test install as 'foobar.php'. file exists? yes +test baseinstalldir: +int(1) +==>test baseinstalldir = 'Foo/Mine'. file exists? yes + -- 2.40.0