* * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see * */ namespace OCA\Files\Controller; use OC\Files\FileInfo; use OCP\AppFramework\Http; use OC\Preview; use OCP\Files\NotFoundException; use OCP\Files\StorageNotAvailableException; use Test\TestCase; use OCP\IRequest; use OCA\Files\Service\TagService; use OCP\AppFramework\Http\DataResponse; /** * Class ApiController * * @package OCA\Files\Controller */ class ApiControllerTest extends TestCase { /** @var string */ private $appName = 'files'; /** @var IRequest */ private $request; /** @var TagService */ private $tagService; /** @var ApiController */ private $apiController; public function setUp() { $this->request = $this->getMockBuilder('\OCP\IRequest') ->disableOriginalConstructor() ->getMock(); $this->tagService = $this->getMockBuilder('\OCA\Files\Service\TagService') ->disableOriginalConstructor() ->getMock(); $this->apiController = new ApiController( $this->appName, $this->request, $this->tagService ); } public function testGetFilesByTagEmpty() { $tagName = 'MyTagName'; $this->tagService->expects($this->once()) ->method('getFilesByTag') ->with($this->equalTo([$tagName])) ->will($this->returnValue([])); $expected = new DataResponse(['files' => []]); $this->assertEquals($expected, $this->apiController->getFilesByTag([$tagName])); } public function testGetFilesByTagSingle() { $tagName = 'MyTagName'; $fileInfo = new FileInfo( '/root.txt', $this->getMockBuilder('\OC\Files\Storage\Storage') ->disableOriginalConstructor() ->getMock(), '/var/www/root.txt', [ 'mtime' => 55, 'mimetype' => 'application/pdf', 'size' => 1234, 'etag' => 'MyEtag', ], $this->getMockBuilder('\OCP\Files\Mount\IMountPoint') ->disableOriginalConstructor() ->getMock() ); $this->tagService->expects($this->once()) ->method('getFilesByTag') ->with($this->equalTo([$tagName])) ->will($this->returnValue([$fileInfo])); $expected = new DataResponse([ 'files' => [ [ 'id' => null, 'parentId' => null, 'date' => 'January 1, 1970 at 12:00:55 AM GMT+0', 'mtime' => 55000, 'icon' => \OCA\Files\Helper::determineIcon($fileInfo), 'name' => 'root.txt', 'permissions' => null, 'mimetype' => 'application/pdf', 'size' => 1234, 'type' => 'file', 'etag' => 'MyEtag', 'path' => '/', 'tags' => [ [ 'MyTagName' ] ], ], ], ]); $this->assertEquals($expected, $this->apiController->getFilesByTag([$tagName])); } public function testGetFilesByTagMultiple() { $tagName = 'MyTagName'; $fileInfo1 = new FileInfo( '/root.txt', $this->getMockBuilder('\OC\Files\Storage\Storage') ->disableOriginalConstructor() ->getMock(), '/var/www/root.txt', [ 'mtime' => 55, 'mimetype' => 'application/pdf', 'size' => 1234, 'etag' => 'MyEtag', ], $this->getMockBuilder('\OCP\Files\Mount\IMountPoint') ->disableOriginalConstructor() ->getMock() ); $fileInfo2 = new FileInfo( '/root.txt', $this->getMockBuilder('\OC\Files\Storage\Storage') ->disableOriginalConstructor() ->getMock(), '/var/www/some/sub.txt', [ 'mtime' => 999, 'mimetype' => 'application/binary', 'size' => 9876, 'etag' => 'SubEtag', ], $this->getMockBuilder('\OCP\Files\Mount\IMountPoint') ->disableOriginalConstructor() ->getMock() ); $this->tagService->expects($this->once()) ->method('getFilesByTag') ->with($this->equalTo([$tagName])) ->will($this->returnValue([$fileInfo1, $fileInfo2])); $expected = new DataResponse([ 'files' => [ [ 'id' => null, 'parentId' => null, 'date' => 'January 1, 1970 at 12:00:55 AM GMT+0', 'mtime' => 55000, 'icon' => \OCA\Files\Helper::determineIcon($fileInfo1), 'name' => 'root.txt', 'permissions' => null, 'mimetype' => 'application/pdf', 'size' => 1234, 'type' => 'file', 'etag' => 'MyEtag', 'path' => '/', 'tags' => [ [ 'MyTagName' ] ], ], [ 'id' => null, 'parentId' => null, 'date' => 'January 1, 1970 at 12:16:39 AM GMT+0', 'mtime' => 999000, 'icon' => \OCA\Files\Helper::determineIcon($fileInfo2), 'name' => 'root.txt', 'permissions' => null, 'mimetype' => 'application/binary', 'size' => 9876, 'type' => 'file', 'etag' => 'SubEtag', 'path' => '/', 'tags' => [ [ 'MyTagName' ] ], ] ], ]); $this->assertEquals($expected, $this->apiController->getFilesByTag([$tagName])); } public function testUpdateFileTagsEmpty() { $expected = new DataResponse([]); $this->assertEquals($expected, $this->apiController->updateFileTags('/path.txt')); } public function testUpdateFileTagsWorking() { $this->tagService->expects($this->once()) ->method('updateFileTags') ->with('/path.txt', ['Tag1', 'Tag2']); $expected = new DataResponse([ 'tags' => [ 'Tag1', 'Tag2' ], ]); $this->assertEquals($expected, $this->apiController->updateFileTags('/path.txt', ['Tag1', 'Tag2'])); } public function testUpdateFileTagsNotFoundException() { $this->tagService->expects($this->once()) ->method('updateFileTags') ->with('/path.txt', ['Tag1', 'Tag2']) ->will($this->throwException(new NotFoundException('My error message'))); $expected = new DataResponse(['message' => 'My error message'], Http::STATUS_NOT_FOUND); $this->assertEquals($expected, $this->apiController->updateFileTags('/path.txt', ['Tag1', 'Tag2'])); } public function testUpdateFileTagsStorageNotAvailableException() { $this->tagService->expects($this->once()) ->method('updateFileTags') ->with('/path.txt', ['Tag1', 'Tag2']) ->will($this->throwException(new StorageNotAvailableException('My error message'))); $expected = new DataResponse(['message' => 'My error message'], Http::STATUS_SERVICE_UNAVAILABLE); $this->assertEquals($expected, $this->apiController->updateFileTags('/path.txt', ['Tag1', 'Tag2'])); } public function testUpdateFileTagsStorageGenericException() { $this->tagService->expects($this->once()) ->method('updateFileTags') ->with('/path.txt', ['Tag1', 'Tag2']) ->will($this->throwException(new \Exception('My error message'))); $expected = new DataResponse(['message' => 'My error message'], Http::STATUS_NOT_FOUND); $this->assertEquals($expected, $this->apiController->updateFileTags('/path.txt', ['Tag1', 'Tag2'])); } } /tl/dev/disable-mailing Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/l10n/lv/files_external.po
blob: eaaf7dcf1c296443de74437faca2c4798ed7255b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# 
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: ownCloud\n"
"Report-Msgid-Bugs-To: http://bugs.owncloud.org/\n"
"POT-Creation-Date: 2013-07-19 01:55-0400\n"
"PO-Revision-Date: 2013-07-19 05:25+0000\n"
"Last-Translator: I Robot <owncloud-bot@tmit.eu>\n"
"Language-Team: Latvian (http://www.transifex.com/projects/p/owncloud/language/lv/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: lv\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);\n"

#: js/dropbox.js:7 js/dropbox.js:28 js/google.js:16 js/google.js:34
msgid "Access granted"
msgstr "Piešķirta pieeja"

#: js/dropbox.js:30 js/dropbox.js:96 js/dropbox.js:102
msgid "Error configuring Dropbox storage"
msgstr "Kļūda, konfigurējot Dropbox krātuvi"

#: js/dropbox.js:65 js/google.js:66
msgid "Grant access"
msgstr "Piešķirt pieeju"

#: js/dropbox.js:101
msgid "Please provide a valid Dropbox app key and secret."
msgstr "Lūdzu, norādiet derīgu Dropbox lietotnes atslēgu un noslēpumu."

#: js/google.js:36 js/google.js:93
msgid "Error configuring Google Drive storage"
msgstr "Kļūda, konfigurējot Google Drive krātuvi"

#: lib/config.php:431
msgid ""
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares "
"is not possible. Please ask your system administrator to install it."
msgstr "<b>Brīdinājums:</b> nav uzinstalēts “smbclient”. Nevar montēt CIFS/SMB koplietojumus. Lūdzu, vaicājiet savam sistēmas administratoram, lai to uzinstalē."

#: lib/config.php:434
msgid ""
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting"
" of FTP shares is not possible. Please ask your system administrator to "
"install it."
msgstr "<b>Brīdinājums: </b> uz PHP nav aktivēts vai instalēts FTP atbalsts. Nevar montēt FTP koplietojumus. Lūdzu, vaicājiet savam sistēmas administratoram, lai to uzinstalē."

#: lib/config.php:437
msgid ""
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. "
"Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask "
"your system administrator to install it."
msgstr ""

#: templates/settings.php:3
msgid "External Storage"
msgstr "Ārējā krātuve"

#: templates/settings.php:9 templates/settings.php:28
msgid "Folder name"
msgstr "Mapes nosaukums"

#: templates/settings.php:10
msgid "External storage"
msgstr "Ārējā krātuve"

#: templates/settings.php:11
msgid "Configuration"
msgstr "Konfigurācija"

#: templates/settings.php:12
msgid "Options"
msgstr "Opcijas"

#: templates/settings.php:13
msgid "Applicable"
msgstr "Piemērojams"

#: templates/settings.php:33
msgid "Add storage"
msgstr "Pievienot krātuvi"

#: templates/settings.php:90
msgid "None set"
msgstr "Neviens nav iestatīts"

#: templates/settings.php:91
msgid "All Users"
msgstr "Visi lietotāji"

#: templates/settings.php:92
msgid "Groups"
msgstr "Grupas"

#: templates/settings.php:100
msgid "Users"
msgstr "Lietotāji"

#: templates/settings.php:113 templates/settings.php:114
#: templates/settings.php:149 templates/settings.php:150
msgid "Delete"
msgstr "Dzēst"

#: templates/settings.php:129
msgid "Enable User External Storage"
msgstr "Aktivēt lietotāja ārējo krātuvi"

#: templates/settings.php:130
msgid "Allow users to mount their own external storage"
msgstr "Ļaut lietotājiem montēt pašiem savu ārējo krātuvi"

#: templates/settings.php:141
msgid "SSL root certificates"
msgstr "SSL saknes sertifikāti"

#: templates/settings.php:159
msgid "Import Root Certificate"
msgstr "Importēt saknes sertifikātus"