]> granicus.if.org Git - php/commitdiff
add testing for baseinstalldir attribute
authorGreg Beaver <cellog@php.net>
Mon, 15 Sep 2003 03:14:12 +0000 (03:14 +0000)
committerGreg Beaver <cellog@php.net>
Mon, 15 Sep 2003 03:14:12 +0000 (03:14 +0000)
pear/tests/pear_installer2.phpt

index 5e86ddf7324b1f42315d9d0f5902c5a1783f8003..83cdecaf6ce2b61c91ace0b4b99f8093c0da107c 100644 (file)
@@ -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
+