summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-01-25 13:24:56 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-25 16:54:40 +0100
commit728caf13f8656fa12253dd512a1fa49897a0566f (patch)
treea60cd7df13eab799f74573b2c64b442475428e58 /tests
parentce753231eb3ed36a2f5250a2b9cc118fad8dad37 (diff)
downloadnextcloud-server-728caf13f8656fa12253dd512a1fa49897a0566f.tar.gz
nextcloud-server-728caf13f8656fa12253dd512a1fa49897a0566f.zip
Adding support of -1 as size to be passed into get and getFile
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/avatartest.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/tests/lib/avatartest.php b/tests/lib/avatartest.php
index d3e615977cb..fe6d3e2fa3f 100644
--- a/tests/lib/avatartest.php
+++ b/tests/lib/avatartest.php
@@ -7,14 +7,13 @@
* See the COPYING-README file.
*/
-use OC\Avatar;
use OCP\Files\Folder;
class AvatarTest extends \Test\TestCase {
- /** @var Folder */
+ /** @var Folder | PHPUnit_Framework_MockObject_MockObject */
private $folder;
- /** @var \OC\Avatar */
+ /** @var \OC\Avatar */
private $avatar;
public function setUp() {
@@ -24,7 +23,6 @@ class AvatarTest extends \Test\TestCase {
$l = $this->getMock('\OCP\IL10N');
$l->method('t')->will($this->returnArgument(0));
$this->avatar = new \OC\Avatar($this->folder, $l);
-
}
public function testGetNoAvatar() {
@@ -47,6 +45,21 @@ class AvatarTest extends \Test\TestCase {
$this->assertEquals($expected->data(), $this->avatar->get(128)->data());
}
+ public function testGetAvatarSizeMinusOne() {
+ $this->folder->method('nodeExists')
+ ->will($this->returnValueMap([
+ ['avatar.jpg', true],
+ ]));
+
+ $expected = new OC_Image(\OC::$SERVERROOT . '/tests/data/testavatar.png');
+
+ $file = $this->getMock('\OCP\Files\File');
+ $file->method('getContent')->willReturn($expected->data());
+ $this->folder->method('get')->with('avatar.jpg')->willReturn($file);
+
+ $this->assertEquals($expected->data(), $this->avatar->get(-1)->data());
+ }
+
public function testGetAvatarNoSizeMatch() {
$this->folder->method('nodeExists')
->will($this->returnValueMap([
; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# 
# Translators:
# xtdv <truong.tx8@gmail.com>, 2013
msgid ""
msgstr ""
"Project-Id-Version: ownCloud\n"
"Report-Msgid-Bugs-To: http://bugs.owncloud.org/\n"
"POT-Creation-Date: 2013-06-24 02:01+0200\n"
"PO-Revision-Date: 2013-06-23 23:15+0000\n"
"Last-Translator: xtdv <truong.tx8@gmail.com>\n"
"Language-Team: Vietnamese (http://www.transifex.com/projects/p/owncloud/language/vi/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: vi\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#: js/dropbox.js:7 js/dropbox.js:28 js/google.js:16 js/google.js:34
msgid "Access granted"
msgstr "Đã cấp quyền truy cập"

#: js/dropbox.js:30 js/dropbox.js:96 js/dropbox.js:102
msgid "Error configuring Dropbox storage"
msgstr "Lỗi cấu hình lưu trữ Dropbox "

#: js/dropbox.js:65 js/google.js:66
msgid "Grant access"
msgstr "Cấp quyền truy cập"

#: js/dropbox.js:101
msgid "Please provide a valid Dropbox app key and secret."
msgstr "Xin vui lòng cung cấp một ứng dụng Dropbox hợp lệ và mã bí mật."

#: js/google.js:36 js/google.js:93
msgid "Error configuring Google Drive storage"
msgstr "Lỗi cấu hình lưu trữ Google Drive"

#: 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>Cảnh báo:</b> \"smbclient\" chưa được cài đặt. Mount CIFS/SMB shares là không thể thực hiện được. Hãy hỏi người quản trị hệ thống để cài đặt nó."

#: 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>Cảnh báo:</b> FTP trong PHP chưa được cài đặt hoặc chưa được  mở. Mount FTP shares là không thể. Xin hãy yêu cầu quản trị hệ thống của bạn cài đặt nó."

#: 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 "<b>Cảnh báo:</b> Tính năng Curl trong PHP chưa được kích hoạt hoặc cài đặt. Việc gắn kết ownCloud / WebDAV hay GoogleDrive không thực hiện được. Vui lòng liên hệ người quản trị để cài đặt nó."

#: templates/settings.php:3
msgid "External Storage"
msgstr "Lưu trữ ngoài"

#: templates/settings.php:9 templates/settings.php:28
msgid "Folder name"
msgstr "Tên thư mục"

#: templates/settings.php:10
msgid "External storage"
msgstr "Lưu trữ ngoài"

#: templates/settings.php:11
msgid "Configuration"
msgstr "Cấu hình"

#: templates/settings.php:12
msgid "Options"
msgstr "Tùy chọn"

#: templates/settings.php:13
msgid "Applicable"
msgstr "Áp dụng"

#: templates/settings.php:33
msgid "Add storage"
msgstr "Thêm bộ nhớ"

#: templates/settings.php:90
msgid "None set"
msgstr "không"

#: templates/settings.php:91
msgid "All Users"
msgstr "Tất cả người dùng"

#: templates/settings.php:92
msgid "Groups"
msgstr "Nhóm"

#: templates/settings.php:100
msgid "Users"
msgstr "Người dùng"

#: templates/settings.php:113 templates/settings.php:114
#: templates/settings.php:149 templates/settings.php:150
msgid "Delete"
msgstr "Xóa"

#: templates/settings.php:129
msgid "Enable User External Storage"
msgstr "Kích hoạt tính năng lưu trữ ngoài"

#: templates/settings.php:130
msgid "Allow users to mount their own external storage"
msgstr "Cho phép người dùng kết nối với lưu trữ riêng bên ngoài của họ"

#: templates/settings.php:141
msgid "SSL root certificates"
msgstr "Chứng chỉ SSL root"

#: templates/settings.php:159
msgid "Import Root Certificate"
msgstr "Nhập Root Certificate"