summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2017-12-12 10:00:26 +0100
committerGitHub <noreply@github.com>2017-12-12 10:00:26 +0100
commit115e7e29cf60c49ddfebece9c25f35f3c5e5dac4 (patch)
treeb64dd23798a3ceae46cb61e3d1fa3d8b2d64b37b
parentd98dea1eb139ae33dfce28f5c61b140518ef4d1d (diff)
parent1ceeab92295ea473b8ac87d358b9b24b07caa938 (diff)
downloadnextcloud-server-115e7e29cf60c49ddfebece9c25f35f3c5e5dac4.tar.gz
nextcloud-server-115e7e29cf60c49ddfebece9c25f35f3c5e5dac4.zip
Merge pull request #7458 from nextcloud/fix-calendar-manager-unit-tests
Fix unit tests for CalendarManager
-rw-r--r--apps/dav/lib/CalDAV/CalendarManager.php10
-rw-r--r--apps/dav/tests/unit/CalDAV/CalendarManagerTest.php7
2 files changed, 14 insertions, 3 deletions
diff --git a/apps/dav/lib/CalDAV/CalendarManager.php b/apps/dav/lib/CalDAV/CalendarManager.php
index a183ecbdf45..59590def5ec 100644
--- a/apps/dav/lib/CalDAV/CalendarManager.php
+++ b/apps/dav/lib/CalDAV/CalendarManager.php
@@ -24,6 +24,7 @@
namespace OCA\DAV\CalDAV;
use OCP\Calendar\IManager;
+use OCP\IConfig;
use OCP\IL10N;
class CalendarManager {
@@ -34,15 +35,20 @@ class CalendarManager {
/** @var IL10N */
private $l10n;
+ /** @var IConfig */
+ private $config;
+
/**
* CalendarManager constructor.
*
* @param CalDavBackend $backend
* @param IL10N $l10n
+ * @param IConfig $config
*/
- public function __construct(CalDavBackend $backend, IL10N $l10n) {
+ public function __construct(CalDavBackend $backend, IL10N $l10n, IConfig $config) {
$this->backend = $backend;
$this->l10n = $l10n;
+ $this->config = $config;
}
/**
@@ -60,7 +66,7 @@ class CalendarManager {
*/
private function register(IManager $cm, array $calendars) {
foreach($calendars as $calendarInfo) {
- $calendar = new Calendar($this->backend, $calendarInfo, $this->l10n);
+ $calendar = new Calendar($this->backend, $calendarInfo, $this->l10n, $this->config);
$cm->registerCalendar(new CalendarImpl(
$calendar,
$calendarInfo,
diff --git a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php
index db8c536da53..1831840610c 100644
--- a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php
@@ -28,6 +28,7 @@ use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CalDAV\CalendarImpl;
use OCA\DAV\CalDAV\CalendarManager;
use OCP\Calendar\IManager;
+use OCP\IConfig;
use OCP\IL10N;
class CalendarManagerTest extends \Test\TestCase {
@@ -38,6 +39,9 @@ class CalendarManagerTest extends \Test\TestCase {
/** @var IL10N | \PHPUnit_Framework_MockObject_MockObject */
private $l10n;
+ /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
+ private $config;
+
/** @var CalendarManager */
private $manager;
@@ -45,8 +49,9 @@ class CalendarManagerTest extends \Test\TestCase {
parent::setUp();
$this->backend = $this->createMock(CalDavBackend::class);
$this->l10n = $this->createMock(IL10N::class);
+ $this->config = $this->createMock(IConfig::class);
$this->manager = new CalendarManager($this->backend,
- $this->l10n);
+ $this->l10n, $this->config);
}
public function testSetupCalendarProvider() {
='#n271'>271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# 
# Translators:
# Dumitru Ursu <>, 2012-2013.
#   <iuranemo@gmail.com>, 2012.
#   <laur.cristescu@gmail.com>, 2012.
msgid ""
msgstr ""
"Project-Id-Version: ownCloud\n"
"Report-Msgid-Bugs-To: http://bugs.owncloud.org/\n"
"POT-Creation-Date: 2013-04-16 02:09+0200\n"
"PO-Revision-Date: 2013-04-16 00:11+0000\n"
"Last-Translator: I Robot <owncloud-bot@tmit.eu>\n"
"Language-Team: Romanian (http://www.transifex.com/projects/p/owncloud/language/ro/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ro\n"
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"

#: ajax/deleteConfiguration.php:34
msgid "Failed to delete the server configuration"
msgstr ""

#: ajax/testConfiguration.php:36
msgid "The configuration is valid and the connection could be established!"
msgstr ""

#: ajax/testConfiguration.php:39
msgid ""
"The configuration is valid, but the Bind failed. Please check the server "
"settings and credentials."
msgstr ""

#: ajax/testConfiguration.php:43
msgid ""
"The configuration is invalid. Please look in the ownCloud log for further "
"details."
msgstr ""

#: js/settings.js:66
msgid "Deletion failed"
msgstr "Ștergerea a eșuat"

#: js/settings.js:82
msgid "Take over settings from recent server configuration?"
msgstr ""

#: js/settings.js:83
msgid "Keep settings?"
msgstr ""

#: js/settings.js:97
msgid "Cannot add server configuration"
msgstr ""

#: js/settings.js:121
msgid "Connection test succeeded"
msgstr ""

#: js/settings.js:126
msgid "Connection test failed"
msgstr ""

#: js/settings.js:136
msgid "Do you really want to delete the current Server Configuration?"
msgstr ""

#: js/settings.js:137
msgid "Confirm Deletion"
msgstr ""

#: templates/settings.php:8
msgid ""
"<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may"
" experience unexpected behaviour. Please ask your system administrator to "
"disable one of them."
msgstr "<b>Atentie:</b> Apps user_ldap si user_webdavauth sunt incompatibile. Este posibil sa experimentati un comportament neasteptat. Vă rugăm să întrebați administratorul de sistem pentru a dezactiva una dintre ele."

#: templates/settings.php:11
msgid ""
"<b>Warning:</b> The PHP LDAP module is not installed, the backend will not "
"work. Please ask your system administrator to install it."
msgstr "<b>Atenție</b> Modulul PHP LDAP nu este instalat, infrastructura nu va funcționa. Contactează administratorul sistemului pentru al instala."

#: templates/settings.php:15
msgid "Server configuration"
msgstr ""

#: templates/settings.php:31
msgid "Add Server Configuration"
msgstr ""

#: templates/settings.php:36
msgid "Host"
msgstr "Gazdă"

#: templates/settings.php:38
msgid ""
"You can omit the protocol, except you require SSL. Then start with ldaps://"
msgstr "Puteți omite protocolul, decât dacă folosiți SSL. Atunci se începe cu ldaps://"

#: templates/settings.php:39
msgid "Base DN"
msgstr "DN de bază"

#: templates/settings.php:40
msgid "One Base DN per line"
msgstr "Un Base DN pe linie"

#: templates/settings.php:41
msgid "You can specify Base DN for users and groups in the Advanced tab"
msgstr "Puteți să specificați DN de bază pentru utilizatori și grupuri în fila Avansat"

#: templates/settings.php:43
msgid "User DN"
msgstr "DN al utilizatorului"

#: templates/settings.php:45
msgid ""
"The DN of the client user with which the bind shall be done, e.g. "
"uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password "
"empty."
msgstr "DN-ul clientului utilizator cu care se va efectua conectarea, d.e. uid=agent,dc=example,dc=com. Pentru acces anonim, lăsăți DN și Parolă libere."

#: templates/settings.php:46
msgid "Password"
msgstr "Parolă"

#: templates/settings.php:49
msgid "For anonymous access, leave DN and Password empty."
msgstr "Pentru acces anonim, lăsați DN și Parolă libere."

#: templates/settings.php:50
msgid "User Login Filter"
msgstr "Filtrare după Nume Utilizator"

#: templates/settings.php:53
#, php-format
msgid ""
"Defines the filter to apply, when login is attempted. %%uid replaces the "
"username in the login action."
msgstr "Definește fitrele care trebuie aplicate, când se încearcă conectarea. %%uid înlocuiește numele utilizatorului în procesul de conectare."

#: templates/settings.php:54
#, php-format
msgid "use %%uid placeholder, e.g. \"uid=%%uid\""
msgstr "folosiți substituentul %%uid , d.e. \"uid=%%uid\""

#: templates/settings.php:55
msgid "User List Filter"
msgstr "Filtrarea după lista utilizatorilor"

#: templates/settings.php:58
msgid "Defines the filter to apply, when retrieving users."
msgstr "Definește filtrele care trebui aplicate, când se peiau utilzatorii."

#: templates/settings.php:59
msgid "without any placeholder, e.g. \"objectClass=person\"."
msgstr "fără substituenți, d.e. \"objectClass=person\"."

#: templates/settings.php:60
msgid "Group Filter"
msgstr "Fitrare Grup"

#: templates/settings.php:63
msgid "Defines the filter to apply, when retrieving groups."
msgstr "Definește filtrele care se aplică, când se preiau grupurile."

#: templates/settings.php:64
msgid "without any placeholder, e.g. \"objectClass=posixGroup\"."
msgstr "fără substituenți, d.e. \"objectClass=posixGroup\""

#: templates/settings.php:68
msgid "Connection Settings"
msgstr ""

#: templates/settings.php:70
msgid "Configuration Active"
msgstr ""

#: templates/settings.php:70
msgid "When unchecked, this configuration will be skipped."
msgstr ""

#: templates/settings.php:71
msgid "Port"
msgstr "Portul"

#: templates/settings.php:72
msgid "Backup (Replica) Host"
msgstr ""

#: templates/settings.php:72
msgid ""
"Give an optional backup host. It must be a replica of the main LDAP/AD "
"server."
msgstr ""

#: templates/settings.php:73
msgid "Backup (Replica) Port"
msgstr ""

#: templates/settings.php:74
msgid "Disable Main Server"
msgstr ""

#: templates/settings.php:74
msgid "When switched on, ownCloud will only connect to the replica server."
msgstr ""

#: templates/settings.php:75
msgid "Use TLS"
msgstr "Utilizează TLS"

#: templates/settings.php:75
msgid "Do not use it additionally for LDAPS connections, it will fail."
msgstr ""

#: templates/settings.php:76
msgid "Case insensitve LDAP server (Windows)"
msgstr "Server LDAP insensibil la majuscule (Windows)"

#: templates/settings.php:77
msgid "Turn off SSL certificate validation."
msgstr "Oprește validarea certificatelor SSL "

#: templates/settings.php:77
msgid ""
"If connection only works with this option, import the LDAP server's SSL "
"certificate in your ownCloud server."
msgstr "Dacă conexiunea lucrează doar cu această opțiune, importează certificatul SSL al serverului LDAP în serverul ownCloud."

#: templates/settings.php:77
msgid "Not recommended, use for testing only."
msgstr "Nu este recomandat, a se utiliza doar pentru testare."

#: templates/settings.php:78
msgid "Cache Time-To-Live"
msgstr ""

#: templates/settings.php:78
msgid "in seconds. A change empties the cache."
msgstr "în secunde. O schimbare curăță memoria tampon."

#: templates/settings.php:80
msgid "Directory Settings"
msgstr ""

#: templates/settings.php:82
msgid "User Display Name Field"
msgstr "Câmpul cu numele vizibil al utilizatorului"

#: templates/settings.php:82
msgid "The LDAP attribute to use to generate the user`s ownCloud name."
msgstr "Atributul LDAP folosit pentru a genera numele de utilizator din ownCloud."

#: templates/settings.php:83
msgid "Base User Tree"
msgstr "Arborele de bază al Utilizatorilor"

#: templates/settings.php:83
msgid "One User Base DN per line"
msgstr "Un User Base DN pe linie"

#: templates/settings.php:84
msgid "User Search Attributes"
msgstr ""

#: templates/settings.php:84 templates/settings.php:87
msgid "Optional; one attribute per line"
msgstr ""

#: templates/settings.php:85
msgid "Group Display Name Field"
msgstr "Câmpul cu numele grupului"

#: templates/settings.php:85
msgid "The LDAP attribute to use to generate the groups`s ownCloud name."
msgstr "Atributul LDAP folosit pentru a genera numele grupurilor din ownCloud"

#: templates/settings.php:86
msgid "Base Group Tree"
msgstr "Arborele de bază al Grupurilor"

#: templates/settings.php:86
msgid "One Group Base DN per line"
msgstr "Un Group Base DN pe linie"

#: templates/settings.php:87
msgid "Group Search Attributes"
msgstr ""

#: templates/settings.php:88
msgid "Group-Member association"
msgstr "Asocierea Grup-Membru"

#: templates/settings.php:90
msgid "Special Attributes"
msgstr ""

#: templates/settings.php:92
msgid "Quota Field"
msgstr ""

#: templates/settings.php:93
msgid "Quota Default"
msgstr ""

#: templates/settings.php:93
msgid "in bytes"
msgstr "în octeți"

#: templates/settings.php:94
msgid "Email Field"
msgstr ""

#: templates/settings.php:95
msgid "User Home Folder Naming Rule"
msgstr ""

#: templates/settings.php:95
msgid ""
"Leave empty for user name (default). Otherwise, specify an LDAP/AD "
"attribute."
msgstr "Lăsați gol pentru numele de utilizator (implicit). În caz contrar, specificați un atribut LDAP / AD."

#: templates/settings.php:99
msgid "Test Configuration"
msgstr ""

#: templates/settings.php:99
msgid "Help"
msgstr "Ajutor"