cvs: php-src /pear/tests pear_installer3.phpt
| From: | Greg Beaver | Date: | Wed, 17 Sep 2003 03:44:25 +0000 |
| Subject: | cvs: php-src /pear/tests pear_installer3.phpt | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-12797@lists.php.net to get a copy of this message | ||
cellog Tue Sep 16 23:44:25 2003 EDT
Modified files:
/php-src/pear/tests pear_installer3.phpt
Log:
add rmdir test, add comment to remind me to finish installed_as test before moving on to next one
Index: php-src/pear/tests/pear_installer3.phpt
diff -u php-src/pear/tests/pear_installer3.phpt:1.5 php-src/pear/tests/pear_installer3.phpt:1.6
--- php-src/pear/tests/pear_installer3.phpt:1.5 Tue Sep 16 23:31:59 2003
+++ php-src/pear/tests/pear_installer3.phpt Tue Sep 16 23:44:25 2003
@@ -95,6 +95,7 @@
DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'renamed.phpt'));
echo 'file renamed.phpt exists?';
+clearstatcache();
echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR
. 'renamed.phpt') ? " yes\n" : " no\n");
echo "test valid commitFileTransaction():\n";
@@ -104,6 +105,7 @@
echo "didn't work!\n";
}
echo 'file renamed.phpt exists?';
+clearstatcache();
echo (file_exists($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR
. 'renamed.phpt') ? " yes\n" : " no\n");
unlink($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR
@@ -111,9 +113,11 @@
echo "Do valid addFileOperation() chmod\n";
touch($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR .
'installertestfooblah.phpt');
+clearstatcache();
$perms = fileperms($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR .
'installertestfooblah.phpt');
// check to see if chmod works on this OS
chmod($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR .
'installertestfooblah.phpt', 0776);
+clearstatcache();
if (fileperms($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR .
'installertestfooblah.phpt')
== $perms && substr(PHP_OS, 0, 3) == 'WIN') {
// we are on windows, so skip this test, but simulate success
@@ -144,7 +148,33 @@
unlink($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR
. 'installertestfooblah.phpt');
+mkdir($temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR
+ . 'installertestfooblah');
+echo "Do valid addFileOperation() rmdir\n";
+echo 'directory exists?';
+clearstatcache();
+echo (is_dir($temp_path . DIRECTORY_SEPARATOR .
+ 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah') ? " yes\n"
: " no\n");
+$installer->addFileOperation('rmdir', array($temp_path . DIRECTORY_SEPARATOR .
+ 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah'));
+
+echo "test valid commitFileTransaction():\n";
+if ($installer->commitFileTransaction()) {
+ echo "worked\n";
+} else {
+ echo "didn't work!\n";
+}
+echo 'directory exists?';
+
+clearstatcache();
+echo (is_dir($temp_path . DIRECTORY_SEPARATOR .
+ 'tmp' . DIRECTORY_SEPARATOR . 'installertestfooblah') ? " yes\n"
: " no\n");
+
+echo "Do valid addFileOperation() installed_as\n";
+// to be finished
+
// invalid tests
+echo "\n==>Invalid tests\n";
echo "Do valid addFileOperation() delete with non-existing file\n";
$installer->addFileOperation('delete', array('gloober62456.phpt'));
echo 'count($installer->file_operations) = ';
@@ -226,6 +256,16 @@
successfully committed 1 file operations
worked
file permissions are: 640
+Do valid addFileOperation() rmdir
+directory exists? yes
+test valid commitFileTransaction():
+about to commit 1 file operations
+successfully committed 1 file operations
+worked
+directory exists? no
+Do valid addFileOperation() installed_as
+
+==>Invalid tests
Do valid addFileOperation() delete with non-existing file
count($installer->file_operations) = int(1)
test invalid commitFileTransaction():