summaryrefslogtreecommitdiffstats
path: root/l10n/templates/files.pot
Commit message (Expand)AuthorAgeFilesLines
* [tx-robot] updated from transifexJenkins for ownCloud2014-11-031-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-11-021-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-11-021-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-11-011-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-311-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-301-2/+2
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-291-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-281-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-271-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-261-2/+2
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-251-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-241-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-231-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-221-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-211-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-201-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-191-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-181-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-171-15/+15
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-161-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-151-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-141-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-131-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-121-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-111-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-101-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-091-4/+4
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-081-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-071-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-061-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-051-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-041-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-031-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-021-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-10-011-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-301-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-291-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-281-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-271-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-261-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-251-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-241-11/+11
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-231-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-221-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-211-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-201-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-191-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-181-1/+1
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-171-15/+15
* [tx-robot] updated from transifexJenkins for ownCloud2014-09-161-1/+1
an class="k">true)); $this->viewMock = $viewMock; $this->files = new \OCA\Files\App($viewMock, $l10nMock); } protected function tearDown() { $result = \OC_User::deleteUser(self::$user); $this->assertTrue($result); $this->logout(); parent::tearDown(); } /** * test rename of file/folder */ function testRenameFolder() { $dir = '/'; $oldname = 'oldname'; $newname = 'newname'; $this->viewMock->expects($this->any()) ->method('file_exists') ->with($this->anything()) ->will($this->returnValueMap(array( array('/', true), array('/oldname', true) ))); $this->viewMock->expects($this->any()) ->method('getFileInfo') ->will($this->returnValue(new \OC\Files\FileInfo( '/new_name', new \OC\Files\Storage\Local(array('datadir' => '/')), '/', array( 'fileid' => 123, 'type' => 'dir', 'mimetype' => 'httpd/unix-directory', 'mtime' => 0, 'permissions' => 31, 'size' => 18, 'etag' => 'abcdef', 'directory' => '/', 'name' => 'new_name', ), null))); $result = $this->files->rename($dir, $oldname, $newname); $this->assertTrue($result['success']); $this->assertEquals(123, $result['data']['id']); $this->assertEquals('new_name', $result['data']['name']); $this->assertEquals(18, $result['data']['size']); $this->assertEquals('httpd/unix-directory', $result['data']['mimetype']); $this->assertEquals('abcdef', $result['data']['etag']); $this->assertFalse(isset($result['data']['tags'])); $this->assertEquals('/', $result['data']['path']); } /** * test rename of file with tag */ function testRenameFileWithTag() { $taggerMock = $this->getMock('\OCP\ITags'); $taggerMock->expects($this->any()) ->method('getTagsForObjects') ->with(array(123)) ->will($this->returnValue(array(123 => array('tag1', 'tag2')))); $tagManagerMock = $this->getMock('\OCP\ITagManager'); $tagManagerMock->expects($this->any()) ->method('load') ->with('files') ->will($this->returnValue($taggerMock)); $oldTagManager = \OC::$server->query('TagManager'); \OC::$server->registerService('TagManager', function ($c) use ($tagManagerMock) { return $tagManagerMock; }); $dir = '/'; $oldname = 'oldname.txt'; $newname = 'newname.txt'; $this->viewMock->expects($this->any()) ->method('file_exists') ->with($this->anything()) ->will($this->returnValueMap(array( array('/', true), array('/oldname.txt', true) ))); $this->viewMock->expects($this->any()) ->method('getFileInfo') ->will($this->returnValue(new \OC\Files\FileInfo( '/new_name.txt', new \OC\Files\Storage\Local(array('datadir' => '/')), '/', array( 'fileid' => 123, 'type' => 'file', 'mimetype' => 'text/plain', 'mtime' => 0, 'permissions' => 31, 'size' => 18, 'etag' => 'abcdef', 'directory' => '/', 'name' => 'new_name.txt', ), null))); $result = $this->files->rename($dir, $oldname, $newname); $this->assertTrue($result['success']); $this->assertEquals(123, $result['data']['id']); $this->assertEquals('new_name.txt', $result['data']['name']); $this->assertEquals(18, $result['data']['size']); $this->assertEquals('text/plain', $result['data']['mimetype']); $this->assertEquals('abcdef', $result['data']['etag']); $this->assertEquals(array('tag1', 'tag2'), $result['data']['tags']); $this->assertEquals('/', $result['data']['path']); \OC::$server->registerService('TagManager', function ($c) use ($oldTagManager) { return $oldTagManager; }); } /** * Test rename inside a folder that doesn't exist any more */ function testRenameInNonExistingFolder() { $dir = '/unexist'; $oldname = 'oldname'; $newname = 'newname'; $this->viewMock->expects($this->at(0)) ->method('file_exists') ->with('/unexist/oldname') ->will($this->returnValue(false)); $this->viewMock->expects($this->any()) ->method('getFileInfo') ->will($this->returnValue(array( 'fileid' => 123, 'type' => 'dir', 'mimetype' => 'httpd/unix-directory', 'size' => 18, 'etag' => 'abcdef', 'directory' => '/unexist', 'name' => 'new_name', ))); $result = $this->files->rename($dir, $oldname, $newname); $this->assertFalse($result['success']); $this->assertEquals('sourcenotfound', $result['data']['code']); } /** * Test move to invalid name */ function testRenameToInvalidName() { $dir = '/'; $oldname = 'oldname'; $newname = 'abc\\'; $result = $this->files->rename($dir, $oldname, $newname); $this->assertFalse($result['success']); $this->assertEquals('File name contains at least one invalid character', $result['data']['message']); $this->assertEquals('invalidname', $result['data']['code']); } }