]> source.dussan.org Git - nextcloud-server.git/commitdiff
[files] rename test class and add rename test
authorMorris Jobke <morris.jobke@gmail.com>
Tue, 7 May 2013 13:24:26 +0000 (15:24 +0200)
committerMorris Jobke <morris.jobke@gmail.com>
Sun, 12 May 2013 09:47:22 +0000 (11:47 +0200)
apps/files/tests/ajax_rename.php

index 81bd2a38350fe54bab9c62cf4e4056f4615596c4..dee956dc8c82cc29450c57b356fc6c5e81a03f72 100644 (file)
@@ -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