summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2013-05-07 15:24:26 +0200
committerMorris Jobke <morris.jobke@gmail.com>2013-05-12 11:47:22 +0200
commit7e23e9767637b6c0776988b1197add44ad0dd17d (patch)
treeadebddb41a31e1a7c833213a99d419e10428c17d
parentd4ba9cf3386097e4ad7cc2dffd990f9ce1a15a83 (diff)
downloadnextcloud-server-7e23e9767637b6c0776988b1197add44ad0dd17d.tar.gz
nextcloud-server-7e23e9767637b6c0776988b1197add44ad0dd17d.zip
[files] rename test class and add rename test
-rw-r--r--apps/files/tests/ajax_rename.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/apps/files/tests/ajax_rename.php b/apps/files/tests/ajax_rename.php
index 81bd2a38350..dee956dc8c8 100644
--- a/apps/files/tests/ajax_rename.php
+++ b/apps/files/tests/ajax_rename.php
@@ -24,7 +24,7 @@
require_once dirname(__FILE__).'/../lib/files.php';
-class Test_Ajax_Rename extends \PHPUnit_Framework_TestCase {
+class Test_OC_Files_Files_Rename extends \PHPUnit_Framework_TestCase {
function setUp() {
// mock OC_L10n
@@ -96,4 +96,25 @@ class Test_Ajax_Rename extends \PHPUnit_Framework_TestCase {
$this->assertEquals($expected, $result);
}
+
+ /**
+ * @brief test rename of file/folder
+ */
+ function testRenameFolder() {
+ $dir = '/';
+ $oldname = 'oldname';
+ $newname = 'newname';
+
+ $result = $this->files->rename($dir, $oldname, $newname);
+ $expected = array(
+ 'success' => true,
+ 'data' => array(
+ 'dir' => $dir,
+ 'file' => $oldname,
+ 'newname' => $newname
+ )
+ );
+
+ $this->assertEquals($expected, $result);
+ }
} \ No newline at end of file