Commit 55e5e9c5ab9513783971a9a5d577f1db3d4b5377
1 parent
1fcb8cd5
Add tests for copying and moving filesystem directories.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3578 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
8 changed files
with
32 additions
and
0 deletions
tests/util/ktutil/dataset1/a
0 → 100644
tests/util/ktutil/dataset1/b/q
0 → 100644
tests/util/ktutil/dataset1/b/t
0 → 100644
tests/util/ktutil/dataset1/b/w
0 → 100644
tests/util/ktutil/dataset1/f
0 → 100644
tests/util/ktutil/dataset1/y
0 → 100644
tests/util/ktutil/testCopy.php
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +require_once("../../../config/dmsDefaults.php"); | |
| 4 | +require_once(KT_LIB_DIR . "/util/ktutil.inc"); | |
| 5 | + | |
| 6 | +$sSrc = KT_DIR . '/tests/util/ktutil/dataset1'; | |
| 7 | + | |
| 8 | +$name = tempnam('/tmp', 'copydirectory'); | |
| 9 | +unlink($name); | |
| 10 | +print $name; | |
| 11 | +KTUtil::copyDirectory($sSrc, $name); | |
| 12 | + | |
| 13 | +?> | ... | ... |
tests/util/ktutil/testMove.php
0 → 100644
| 1 | +<?php | |
| 2 | + | |
| 3 | +require_once("../../../config/dmsDefaults.php"); | |
| 4 | +require_once(KT_LIB_DIR . "/util/ktutil.inc"); | |
| 5 | + | |
| 6 | +$sSrc = KT_DIR . '/tests/util/ktutil/dataset1'; | |
| 7 | + | |
| 8 | +$name = tempnam('/tmp', 'movedirectory'); | |
| 9 | +unlink($name); | |
| 10 | +print "copying to $name first\n"; | |
| 11 | +KTUtil::copyDirectory($sSrc, $name); | |
| 12 | + | |
| 13 | +$sSrc = $name; | |
| 14 | +$name = tempnam('/tmp', 'movedirectory'); | |
| 15 | +unlink($name); | |
| 16 | +print "moving to $name\n"; | |
| 17 | +KTUtil::moveDirectory($sSrc, $name); | |
| 18 | + | |
| 19 | +?> | ... | ... |