1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 11:13:36 +02:00

finished transaction tests

This commit is contained in:
Greg Beaver
2003-09-18 04:24:25 +00:00
parent 103bab81a3
commit c6d102bfe4
+64 -1
View File
@@ -171,7 +171,59 @@ 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
$installer->addFileOperation('installed_as', array('test.php',
$temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR .
'glomp' . DIRECTORY_SEPARATOR . 'fromp' . DIRECTORY_SEPARATOR
. 'installertestfooblah.phpt',
$temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR,
'glomp' . DIRECTORY_SEPARATOR . 'fromp'));
echo "test valid commitFileTransaction():\n";
if ($installer->commitFileTransaction()) {
echo "worked\n";
} else {
echo "didn't work!\n";
}
if (isset($installer->pkginfo['filelist'])) {
echo "filelist created\n";
} else {
echo "filelist not created!\n";
}
if (isset($installer->pkginfo['filelist']['test.php'])) {
echo "filelist test.php created\n";
} else {
echo "filelist test.php not created!\n";
}
if (isset($installer->pkginfo['filelist']['test.php']['installed_as'])) {
echo "filelist test.php installed_as created\n";
} else {
echo "filelist test.php installed_as not created!\n";
}
$p = $temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR .
'glomp' . DIRECTORY_SEPARATOR . 'fromp' . DIRECTORY_SEPARATOR
. 'installertestfooblah.phpt';
if (@$installer->pkginfo['filelist']['test.php']['installed_as'] == $p) {
echo "filelist test.php installed_as is correct\n";
} else {
echo "filelist test.php installed_as is not correct!\n";
}
if (isset($installer->pkginfo['filelist']['dirtree'])) {
echo "filelist dirtree created\n";
} else {
echo "filelist dirtree not created!\n";
}
$p = $temp_path . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR .
'glomp';
if (isset($installer->pkginfo['filelist']['dirtree'][$p])) {
echo "filelist dirtree glomp created\n";
} else {
echo "filelist dirtree glomp not created!\n";
}
$p .= DIRECTORY_SEPARATOR . 'fromp';
if (isset($installer->pkginfo['filelist']['dirtree'][$p])) {
echo "filelist dirtree fromp created\n";
} else {
echo "filelist dirtree fromp not created!\n";
}
// invalid tests
echo "\n==>Invalid tests\n";
@@ -264,6 +316,17 @@ successfully committed 1 file operations
worked
directory exists? no
Do valid addFileOperation() installed_as
test valid commitFileTransaction():
about to commit 1 file operations
successfully committed 1 file operations
worked
filelist created
filelist test.php created
filelist test.php installed_as created
filelist test.php installed_as is correct
filelist dirtree created
filelist dirtree glomp created
filelist dirtree fromp created
==>Invalid tests
Do valid addFileOperation() delete with non-existing file