Add TZ & LANG
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
f6d17da24e
commit
677003d1b6
|
@ -17,3 +17,4 @@ yarn-error.log*
|
|||
js/
|
||||
build/
|
||||
coverage*
|
||||
vendor/
|
||||
|
|
12
.travis.yml
12
.travis.yml
|
@ -2,8 +2,8 @@ sudo: required
|
|||
dist: trusty
|
||||
language: php
|
||||
php:
|
||||
- 7.1
|
||||
- 7.2
|
||||
- 7.3
|
||||
|
||||
# Server requires PostgreSQL >= 9.5
|
||||
addons:
|
||||
|
@ -35,14 +35,14 @@ branches:
|
|||
|
||||
matrix:
|
||||
include:
|
||||
- php: 7.1
|
||||
- php: 7.2
|
||||
env: "DB=mysql CORE_BRANCH=master"
|
||||
- php: 7.2
|
||||
- php: 7.3
|
||||
env: "DB=mysql CORE_BRANCH=master TEST_JS=TRUE PHP_COVERAGE=TRUE"
|
||||
- php: 7.1
|
||||
env: "DB=pgsql CORE_BRANCH=master"
|
||||
- php: 7.2
|
||||
env: "DB=pgsql CORE_BRANCH=master"
|
||||
- php: 7.3
|
||||
env: "DB=pgsql CORE_BRANCH=master"
|
||||
fast_finish: true
|
||||
|
||||
cache:
|
||||
|
@ -58,6 +58,8 @@ before_install:
|
|||
- if [[ "$DB" == 'mysql' ]]; then mysql -u root -e 'create database oc_autotest;'; fi
|
||||
- if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY '';"; fi
|
||||
- if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "GRANT ALL ON oc_autotest.* TO 'oc_autotest'@'localhost';"; fi
|
||||
- composer self-update
|
||||
- make install-composer-deps-dev
|
||||
- cd ..
|
||||
- git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b $CORE_BRANCH core
|
||||
- mv contacts core/apps/
|
||||
|
|
19
Makefile
19
Makefile
|
@ -20,6 +20,17 @@ npm-init:
|
|||
npm-update:
|
||||
npm update
|
||||
|
||||
composer.phar:
|
||||
curl -sS https://getcomposer.org/installer | php
|
||||
|
||||
install-deps: install-composer-deps-dev install-npm-deps-dev
|
||||
|
||||
install-composer-deps: composer.phar
|
||||
php composer.phar install --no-dev -o
|
||||
|
||||
install-composer-deps-dev: composer.phar
|
||||
php composer.phar install -o
|
||||
|
||||
# Building
|
||||
build-js:
|
||||
npm run dev
|
||||
|
@ -41,12 +52,12 @@ test-coverage:
|
|||
npm run test:coverage
|
||||
|
||||
test-php:
|
||||
phpunit -c phpunit.xml
|
||||
phpunit -c phpunit.integration.xml
|
||||
php composer.phar run test:unit
|
||||
php composer.phar run test:integration
|
||||
|
||||
test-php-coverage:
|
||||
phpunit -c phpunit.xml --coverage-clover=coverage-unit.xml
|
||||
phpunit -c phpunit.integration.xml --coverage-clover=coverage-integration.xml
|
||||
php composer.phar run test:unit -- --coverage-clover=coverage-unit.xml
|
||||
php composer.phar run test:integration -- --coverage-clover=coverage-integration.xml
|
||||
|
||||
# Linting
|
||||
lint:
|
||||
|
|
|
@ -81,7 +81,8 @@ If you contribute, participate or interact with this community, please respect [
|
|||
This guide will help you get started:
|
||||
- :dancer: :smile: [Opening a pull request](https://opensource.guide/how-to-contribute/#opening-a-pull-request)
|
||||
|
||||
|
||||
# Thanks
|
||||
- language icon by [nociconist](https://thenounproject.com/nociconist/)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"require-dev": {
|
||||
"christophwurst/nextcloud_testing": "^0.7.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test:unit": "phpunit -c phpunit.xml --fail-on-warning",
|
||||
"test:integration": "phpunit -c phpunit.integration.xml --fail-on-warning"
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -28,6 +28,7 @@
|
|||
@include icon-black-white('eye', 'contacts', 1);
|
||||
@include icon-black-white('up', 'contacts', 1);
|
||||
@include icon-black-white('no-calendar', 'contacts', 1);
|
||||
@include icon-black-white('language', 'contacts', 2);
|
||||
|
||||
.icon-up-force-white {
|
||||
// using #fffffe to trick the accessibility dark theme icon invert
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 5.12 5.12"><path d="M2.2 2.67c.18-.1.33-.38.35-.78H2.2zm-.22 0v-.78h-.35c.03.4.19.69.35.78zM2.2.89v.77h.34C2.53 1.28 2.38.98 2.2.9zm-.58.77h.35V.9c-.16.1-.32.39-.35.77zm.99-.64a1.61 1.6 0 0 1 .17.64h.23a.93.92 0 0 0-.4-.64zm-1.44.87a.93.92 0 0 0 .39.65 1.61 1.6 0 0 1-.16-.65z"/><path d="M4.2 2.83V.74A.58.58 0 0 0 3.6.16H.58A.58.58 0 0 0 0 .73v2.1a.58.58 0 0 0 .57.57h.82V4a.11.11 0 0 0 .19.08l.91-.68h1.12a.58.58 0 0 0 .57-.57zm-2.1.11a1.17 1.16 0 1 1 1.16-1.16 1.17 1.16 0 0 1-1.17 1.16z"/><path d="M2.62 2.54a.93.92 0 0 0 .4-.65h-.23a1.61 1.6 0 0 1-.17.65zm-1.44-.88h.23a1.61 1.6 0 0 1 .16-.64.93.92 0 0 0-.4.64zm3.37-.8a.11.11 0 0 0 0 .22.34.34 0 0 1 .34.35v2.1a.34.34 0 0 1-.34.34H3.6a.11.11 0 0 0-.11.1v.48l-.76-.55a.11.11 0 0 0-.13.18l.93.7a.11.11 0 0 0 .19-.1V4.1h.8a.58.58 0 0 0 .59-.58V1.44a.58.58 0 0 0-.57-.58z"/></svg>
|
After Width: | Height: | Size: 908 B |
|
@ -25,17 +25,29 @@ namespace OCA\Contacts\Controller;
|
|||
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\IInitialStateService;
|
||||
use OCP\L10N\IFactory;
|
||||
use OCP\IRequest;
|
||||
|
||||
class PageController extends Controller {
|
||||
|
||||
protected $appName;
|
||||
|
||||
/** @var IInitialStateService */
|
||||
private $initialStateService;
|
||||
|
||||
/** @var IFactory */
|
||||
private $languageFactory;
|
||||
|
||||
public function __construct(string $AppName,
|
||||
IRequest $request) {
|
||||
IRequest $request,
|
||||
IInitialStateService $initialStateService,
|
||||
IFactory $languageFactory) {
|
||||
parent::__construct($AppName, $request);
|
||||
|
||||
$this->appName = $AppName;
|
||||
$this->initialStateService = $initialStateService;
|
||||
$this->languageFactory = $languageFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -45,6 +57,8 @@ class PageController extends Controller {
|
|||
* Default routing
|
||||
*/
|
||||
public function index(): TemplateResponse {
|
||||
$locales = $this->languageFactory->findAvailableLocales();
|
||||
$this->initialStateService->provideInitialState($this->appName, 'locales', $locales);
|
||||
return new TemplateResponse('contacts', 'main'); // templates/main.php
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7886,6 +7886,14 @@
|
|||
"core-js": "^3.1.4"
|
||||
}
|
||||
},
|
||||
"nextcloud-initial-state": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/nextcloud-initial-state/-/nextcloud-initial-state-0.0.3.tgz",
|
||||
"integrity": "sha512-sL0dKbOb63QwvkAfQdDC5AldshVwaY8B8tKpAci7UMmJV3M1KLxTBzQoY+CVy03/uqTvvFt3Brz/Bd2UNp3zsQ==",
|
||||
"requires": {
|
||||
"core-js": "^3.1.4"
|
||||
}
|
||||
},
|
||||
"nextcloud-l10n": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/nextcloud-l10n/-/nextcloud-l10n-0.1.0.tgz",
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
"moment": "^2.24.0",
|
||||
"nextcloud-auth": "0.0.3",
|
||||
"nextcloud-dialogs": "0.0.3",
|
||||
"nextcloud-initial-state": "0.0.3",
|
||||
"nextcloud-l10n": "0.1.0",
|
||||
"nextcloud-router": "0.0.9",
|
||||
"nextcloud-vue": "^0.12.3",
|
||||
|
|
|
@ -92,7 +92,15 @@ export default {
|
|||
// matching value to the options we provide
|
||||
matchedOptions: {
|
||||
get() {
|
||||
let selected = this.propModel.options.find(option => option.id === this.localValue)
|
||||
// match lowercase as well
|
||||
let selected = this.propModel.options.find(option => option.id === this.localValue
|
||||
|| option.id === this.localValue.toLowerCase())
|
||||
|
||||
// if the model provided a custom match fallback, use it
|
||||
if (!selected && this.propModel.greedyMatch) {
|
||||
selected = this.propModel.greedyMatch(this.localValue, this.propModel.options)
|
||||
}
|
||||
|
||||
// properly display array as a string
|
||||
if (Array.isArray(this.localValue)) {
|
||||
return selected || {
|
||||
|
|
|
@ -20,8 +20,19 @@
|
|||
*
|
||||
*/
|
||||
import { VCardTime } from 'ical.js'
|
||||
import { loadState } from 'nextcloud-initial-state'
|
||||
|
||||
import ActionCopyNtoFN from '../components/Actions/ActionCopyNtoFN'
|
||||
import ActionToggleYear from '../components/Actions/ActionToggleYear'
|
||||
import zones from './zones'
|
||||
|
||||
const localesState = loadState('contacts', 'locales')
|
||||
const locales = localesState
|
||||
? localesState.map(({ code, name }) => ({
|
||||
id: code.toLowerCase().replace('_', '-'),
|
||||
name
|
||||
}))
|
||||
: []
|
||||
|
||||
const properties = {
|
||||
nickname: {
|
||||
|
@ -288,6 +299,37 @@ const properties = {
|
|||
{ id: 'N', name: t('contacts', 'None') },
|
||||
{ id: 'U', name: t('contacts', 'Unknown') }
|
||||
]
|
||||
},
|
||||
tz: {
|
||||
readableName: t('contacts', 'Timezone'),
|
||||
force: 'select',
|
||||
icon: 'icon-timezone',
|
||||
options: zones.map(zone => ({
|
||||
id: zone,
|
||||
name: zone
|
||||
}))
|
||||
},
|
||||
lang: {
|
||||
readableName: t('contacts', 'Spoken languages'),
|
||||
icon: 'icon-language',
|
||||
defaultValue: {
|
||||
value: 'en'
|
||||
},
|
||||
multiple: true
|
||||
}
|
||||
}
|
||||
|
||||
if (locales.length > 0) {
|
||||
properties.lang.force = 'select'
|
||||
properties.lang.options = locales
|
||||
properties.lang.greedyMatch = function(value, options) {
|
||||
// each locale already have the base code (e.g. fr in fr_ca)
|
||||
// in the list, meaning the only use case for this is a more
|
||||
// complete language tag than the short one we have
|
||||
// value: fr-ca-xxx... will be matched with option fr
|
||||
return options.find(({ id }) => {
|
||||
return id === value.split('-')[0]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,450 @@
|
|||
/**
|
||||
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* 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
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
export default [
|
||||
'Africa/Abidjan',
|
||||
'Africa/Accra',
|
||||
'Africa/Addis_Ababa',
|
||||
'Africa/Algiers',
|
||||
'Africa/Asmara',
|
||||
'Africa/Bamako',
|
||||
'Africa/Bangui',
|
||||
'Africa/Banjul',
|
||||
'Africa/Bissau',
|
||||
'Africa/Blantyre',
|
||||
'Africa/Brazzaville',
|
||||
'Africa/Bujumbura',
|
||||
'Africa/Cairo',
|
||||
'Africa/Casablanca',
|
||||
'Africa/Ceuta',
|
||||
'Africa/Conakry',
|
||||
'Africa/Dakar',
|
||||
'Africa/Dar_es_Salaam',
|
||||
'Africa/Djibouti',
|
||||
'Africa/Douala',
|
||||
'Africa/El_Aaiun',
|
||||
'Africa/Freetown',
|
||||
'Africa/Gaborone',
|
||||
'Africa/Harare',
|
||||
'Africa/Johannesburg',
|
||||
'Africa/Juba',
|
||||
'Africa/Kampala',
|
||||
'Africa/Khartoum',
|
||||
'Africa/Kigali',
|
||||
'Africa/Kinshasa',
|
||||
'Africa/Lagos',
|
||||
'Africa/Libreville',
|
||||
'Africa/Lome',
|
||||
'Africa/Luanda',
|
||||
'Africa/Lubumbashi',
|
||||
'Africa/Lusaka',
|
||||
'Africa/Malabo',
|
||||
'Africa/Maputo',
|
||||
'Africa/Maseru',
|
||||
'Africa/Mbabane',
|
||||
'Africa/Mogadishu',
|
||||
'Africa/Monrovia',
|
||||
'Africa/Nairobi',
|
||||
'Africa/Ndjamena',
|
||||
'Africa/Niamey',
|
||||
'Africa/Nouakchott',
|
||||
'Africa/Ouagadougou',
|
||||
'Africa/Porto-Novo',
|
||||
'Africa/Sao_Tome',
|
||||
'Africa/Tripoli',
|
||||
'Africa/Tunis',
|
||||
'Africa/Windhoek',
|
||||
'America/Adak',
|
||||
'America/Anchorage',
|
||||
'America/Anguilla',
|
||||
'America/Antigua',
|
||||
'America/Araguaina',
|
||||
'America/Argentina/Buenos_Aires',
|
||||
'America/Argentina/Catamarca',
|
||||
'America/Argentina/Cordoba',
|
||||
'America/Argentina/Jujuy',
|
||||
'America/Argentina/La_Rioja',
|
||||
'America/Argentina/Mendoza',
|
||||
'America/Argentina/Rio_Gallegos',
|
||||
'America/Argentina/Salta',
|
||||
'America/Argentina/San_Juan',
|
||||
'America/Argentina/San_Luis',
|
||||
'America/Argentina/Tucuman',
|
||||
'America/Argentina/Ushuaia',
|
||||
'America/Aruba',
|
||||
'America/Asuncion',
|
||||
'America/Atikokan',
|
||||
'America/Bahia',
|
||||
'America/Bahia_Banderas',
|
||||
'America/Barbados',
|
||||
'America/Belem',
|
||||
'America/Belize',
|
||||
'America/Blanc-Sablon',
|
||||
'America/Boa_Vista',
|
||||
'America/Bogota',
|
||||
'America/Boise',
|
||||
'America/Cambridge_Bay',
|
||||
'America/Campo_Grande',
|
||||
'America/Cancun',
|
||||
'America/Caracas',
|
||||
'America/Cayenne',
|
||||
'America/Cayman',
|
||||
'America/Chicago',
|
||||
'America/Chihuahua',
|
||||
'America/Costa_Rica',
|
||||
'America/Creston',
|
||||
'America/Cuiaba',
|
||||
'America/Curacao',
|
||||
'America/Danmarkshavn',
|
||||
'America/Dawson',
|
||||
'America/Dawson_Creek',
|
||||
'America/Denver',
|
||||
'America/Detroit',
|
||||
'America/Dominica',
|
||||
'America/Edmonton',
|
||||
'America/Eirunepe',
|
||||
'America/El_Salvador',
|
||||
'America/Fort_Nelson',
|
||||
'America/Fortaleza',
|
||||
'America/Glace_Bay',
|
||||
'America/Godthab',
|
||||
'America/Goose_Bay',
|
||||
'America/Grand_Turk',
|
||||
'America/Grenada',
|
||||
'America/Guadeloupe',
|
||||
'America/Guatemala',
|
||||
'America/Guayaquil',
|
||||
'America/Guyana',
|
||||
'America/Halifax',
|
||||
'America/Havana',
|
||||
'America/Hermosillo',
|
||||
'America/Indiana/Indianapolis',
|
||||
'America/Indiana/Knox',
|
||||
'America/Indiana/Marengo',
|
||||
'America/Indiana/Petersburg',
|
||||
'America/Indiana/Tell_City',
|
||||
'America/Indiana/Vevay',
|
||||
'America/Indiana/Vincennes',
|
||||
'America/Indiana/Winamac',
|
||||
'America/Inuvik',
|
||||
'America/Iqaluit',
|
||||
'America/Jamaica',
|
||||
'America/Juneau',
|
||||
'America/Kentucky/Louisville',
|
||||
'America/Kentucky/Monticello',
|
||||
'America/Kralendijk',
|
||||
'America/La_Paz',
|
||||
'America/Lima',
|
||||
'America/Los_Angeles',
|
||||
'America/Lower_Princes',
|
||||
'America/Maceio',
|
||||
'America/Managua',
|
||||
'America/Manaus',
|
||||
'America/Marigot',
|
||||
'America/Martinique',
|
||||
'America/Matamoros',
|
||||
'America/Mazatlan',
|
||||
'America/Menominee',
|
||||
'America/Merida',
|
||||
'America/Metlakatla',
|
||||
'America/Mexico_City',
|
||||
'America/Miquelon',
|
||||
'America/Moncton',
|
||||
'America/Monterrey',
|
||||
'America/Montevideo',
|
||||
'America/Montserrat',
|
||||
'America/Nassau',
|
||||
'America/New_York',
|
||||
'America/Nipigon',
|
||||
'America/Nome',
|
||||
'America/Noronha',
|
||||
'America/North_Dakota/Beulah',
|
||||
'America/North_Dakota/Center',
|
||||
'America/North_Dakota/New_Salem',
|
||||
'America/Ojinaga',
|
||||
'America/Panama',
|
||||
'America/Pangnirtung',
|
||||
'America/Paramaribo',
|
||||
'America/Phoenix',
|
||||
'America/Port-au-Prince',
|
||||
'America/Port_of_Spain',
|
||||
'America/Porto_Velho',
|
||||
'America/Puerto_Rico',
|
||||
'America/Rainy_River',
|
||||
'America/Rankin_Inlet',
|
||||
'America/Recife',
|
||||
'America/Regina',
|
||||
'America/Resolute',
|
||||
'America/Rio_Branco',
|
||||
'America/Santarem',
|
||||
'America/Santiago',
|
||||
'America/Santo_Domingo',
|
||||
'America/Sao_Paulo',
|
||||
'America/Scoresbysund',
|
||||
'America/Sitka',
|
||||
'America/St_Barthelemy',
|
||||
'America/St_Johns',
|
||||
'America/St_Kitts',
|
||||
'America/St_Lucia',
|
||||
'America/St_Thomas',
|
||||
'America/St_Vincent',
|
||||
'America/Swift_Current',
|
||||
'America/Tegucigalpa',
|
||||
'America/Thule',
|
||||
'America/Thunder_Bay',
|
||||
'America/Tijuana',
|
||||
'America/Toronto',
|
||||
'America/Tortola',
|
||||
'America/Vancouver',
|
||||
'America/Whitehorse',
|
||||
'America/Winnipeg',
|
||||
'America/Yakutat',
|
||||
'America/Yellowknife',
|
||||
'Antarctica/Casey',
|
||||
'Antarctica/Davis',
|
||||
'Antarctica/DumontDUrville',
|
||||
'Antarctica/Macquarie',
|
||||
'Antarctica/Mawson',
|
||||
'Antarctica/McMurdo',
|
||||
'Antarctica/Palmer',
|
||||
'Antarctica/Rothera',
|
||||
'Antarctica/Syowa',
|
||||
'Antarctica/Troll',
|
||||
'Antarctica/Vostok',
|
||||
'Arctic/Longyearbyen',
|
||||
'Asia/Aden',
|
||||
'Asia/Almaty',
|
||||
'Asia/Amman',
|
||||
'Asia/Anadyr',
|
||||
'Asia/Aqtau',
|
||||
'Asia/Aqtobe',
|
||||
'Asia/Ashgabat',
|
||||
'Asia/Atyrau',
|
||||
'Asia/Baghdad',
|
||||
'Asia/Bahrain',
|
||||
'Asia/Baku',
|
||||
'Asia/Bangkok',
|
||||
'Asia/Barnaul',
|
||||
'Asia/Beirut',
|
||||
'Asia/Bishkek',
|
||||
'Asia/Brunei',
|
||||
'Asia/Chita',
|
||||
'Asia/Choibalsan',
|
||||
'Asia/Colombo',
|
||||
'Asia/Damascus',
|
||||
'Asia/Dhaka',
|
||||
'Asia/Dili',
|
||||
'Asia/Dubai',
|
||||
'Asia/Dushanbe',
|
||||
'Asia/Famagusta',
|
||||
'Asia/Gaza',
|
||||
'Asia/Hebron',
|
||||
'Asia/Ho_Chi_Minh',
|
||||
'Asia/Hong_Kong',
|
||||
'Asia/Hovd',
|
||||
'Asia/Irkutsk',
|
||||
'Asia/Istanbul',
|
||||
'Asia/Jakarta',
|
||||
'Asia/Jayapura',
|
||||
'Asia/Jerusalem',
|
||||
'Asia/Kabul',
|
||||
'Asia/Kamchatka',
|
||||
'Asia/Karachi',
|
||||
'Asia/Kathmandu',
|
||||
'Asia/Khandyga',
|
||||
'Asia/Kolkata',
|
||||
'Asia/Krasnoyarsk',
|
||||
'Asia/Kuala_Lumpur',
|
||||
'Asia/Kuching',
|
||||
'Asia/Kuwait',
|
||||
'Asia/Macau',
|
||||
'Asia/Magadan',
|
||||
'Asia/Makassar',
|
||||
'Asia/Manila',
|
||||
'Asia/Muscat',
|
||||
'Asia/Nicosia',
|
||||
'Asia/Novokuznetsk',
|
||||
'Asia/Novosibirsk',
|
||||
'Asia/Omsk',
|
||||
'Asia/Oral',
|
||||
'Asia/Phnom_Penh',
|
||||
'Asia/Pontianak',
|
||||
'Asia/Pyongyang',
|
||||
'Asia/Qatar',
|
||||
'Asia/Qyzylorda',
|
||||
'Asia/Riyadh',
|
||||
'Asia/Sakhalin',
|
||||
'Asia/Samarkand',
|
||||
'Asia/Seoul',
|
||||
'Asia/Shanghai',
|
||||
'Asia/Singapore',
|
||||
'Asia/Srednekolymsk',
|
||||
'Asia/Taipei',
|
||||
'Asia/Tashkent',
|
||||
'Asia/Tbilisi',
|
||||
'Asia/Tehran',
|
||||
'Asia/Thimphu',
|
||||
'Asia/Tokyo',
|
||||
'Asia/Tomsk',
|
||||
'Asia/Ulaanbaatar',
|
||||
'Asia/Urumqi',
|
||||
'Asia/Ust-Nera',
|
||||
'Asia/Vientiane',
|
||||
'Asia/Vladivostok',
|
||||
'Asia/Yakutsk',
|
||||
'Asia/Yangon',
|
||||
'Asia/Yekaterinburg',
|
||||
'Asia/Yerevan',
|
||||
'Atlantic/Azores',
|
||||
'Atlantic/Bermuda',
|
||||
'Atlantic/Canary',
|
||||
'Atlantic/Cape_Verde',
|
||||
'Atlantic/Faroe',
|
||||
'Atlantic/Madeira',
|
||||
'Atlantic/Reykjavik',
|
||||
'Atlantic/South_Georgia',
|
||||
'Atlantic/St_Helena',
|
||||
'Atlantic/Stanley',
|
||||
'Australia/Adelaide',
|
||||
'Australia/Brisbane',
|
||||
'Australia/Broken_Hill',
|
||||
'Australia/Currie',
|
||||
'Australia/Darwin',
|
||||
'Australia/Eucla',
|
||||
'Australia/Hobart',
|
||||
'Australia/Lindeman',
|
||||
'Australia/Lord_Howe',
|
||||
'Australia/Melbourne',
|
||||
'Australia/Perth',
|
||||
'Australia/Sydney',
|
||||
'Europe/Amsterdam',
|
||||
'Europe/Andorra',
|
||||
'Europe/Astrakhan',
|
||||
'Europe/Athens',
|
||||
'Europe/Belgrade',
|
||||
'Europe/Berlin',
|
||||
'Europe/Bratislava',
|
||||
'Europe/Brussels',
|
||||
'Europe/Bucharest',
|
||||
'Europe/Budapest',
|
||||
'Europe/Busingen',
|
||||
'Europe/Chisinau',
|
||||
'Europe/Copenhagen',
|
||||
'Europe/Dublin',
|
||||
'Europe/Gibraltar',
|
||||
'Europe/Guernsey',
|
||||
'Europe/Helsinki',
|
||||
'Europe/Isle_of_Man',
|
||||
'Europe/Istanbul',
|
||||
'Europe/Jersey',
|
||||
'Europe/Kaliningrad',
|
||||
'Europe/Kiev',
|
||||
'Europe/Kirov',
|
||||
'Europe/Lisbon',
|
||||
'Europe/Ljubljana',
|
||||
'Europe/London',
|
||||
'Europe/Luxembourg',
|
||||
'Europe/Madrid',
|
||||
'Europe/Malta',
|
||||
'Europe/Mariehamn',
|
||||
'Europe/Minsk',
|
||||
'Europe/Monaco',
|
||||
'Europe/Moscow',
|
||||
'Europe/Nicosia',
|
||||
'Europe/Oslo',
|
||||
'Europe/Paris',
|
||||
'Europe/Podgorica',
|
||||
'Europe/Prague',
|
||||
'Europe/Riga',
|
||||
'Europe/Rome',
|
||||
'Europe/Samara',
|
||||
'Europe/San_Marino',
|
||||
'Europe/Sarajevo',
|
||||
'Europe/Saratov',
|
||||
'Europe/Simferopol',
|
||||
'Europe/Skopje',
|
||||
'Europe/Sofia',
|
||||
'Europe/Stockholm',
|
||||
'Europe/Tallinn',
|
||||
'Europe/Tirane',
|
||||
'Europe/Ulyanovsk',
|
||||
'Europe/Uzhgorod',
|
||||
'Europe/Vaduz',
|
||||
'Europe/Vatican',
|
||||
'Europe/Vienna',
|
||||
'Europe/Vilnius',
|
||||
'Europe/Volgograd',
|
||||
'Europe/Warsaw',
|
||||
'Europe/Zagreb',
|
||||
'Europe/Zaporozhye',
|
||||
'Europe/Zurich',
|
||||
'Indian/Antananarivo',
|
||||
'Indian/Chagos',
|
||||
'Indian/Christmas',
|
||||
'Indian/Cocos',
|
||||
'Indian/Comoro',
|
||||
'Indian/Kerguelen',
|
||||
'Indian/Mahe',
|
||||
'Indian/Maldives',
|
||||
'Indian/Mauritius',
|
||||
'Indian/Mayotte',
|
||||
'Indian/Reunion',
|
||||
'Pacific/Apia',
|
||||
'Pacific/Auckland',
|
||||
'Pacific/Bougainville',
|
||||
'Pacific/Chatham',
|
||||
'Pacific/Chuuk',
|
||||
'Pacific/Easter',
|
||||
'Pacific/Efate',
|
||||
'Pacific/Enderbury',
|
||||
'Pacific/Fakaofo',
|
||||
'Pacific/Fiji',
|
||||
'Pacific/Funafuti',
|
||||
'Pacific/Galapagos',
|
||||
'Pacific/Gambier',
|
||||
'Pacific/Guadalcanal',
|
||||
'Pacific/Guam',
|
||||
'Pacific/Honolulu',
|
||||
'Pacific/Johnston',
|
||||
'Pacific/Kiritimati',
|
||||
'Pacific/Kosrae',
|
||||
'Pacific/Kwajalein',
|
||||
'Pacific/Majuro',
|
||||
'Pacific/Marquesas',
|
||||
'Pacific/Midway',
|
||||
'Pacific/Nauru',
|
||||
'Pacific/Niue',
|
||||
'Pacific/Norfolk',
|
||||
'Pacific/Noumea',
|
||||
'Pacific/Pago_Pago',
|
||||
'Pacific/Palau',
|
||||
'Pacific/Pitcairn',
|
||||
'Pacific/Pohnpei',
|
||||
'Pacific/Port_Moresby',
|
||||
'Pacific/Rarotonga',
|
||||
'Pacific/Saipan',
|
||||
'Pacific/Tahiti',
|
||||
'Pacific/Tarawa',
|
||||
'Pacific/Tongatapu',
|
||||
'Pacific/Wake',
|
||||
'Pacific/Wallis'
|
||||
]
|
|
@ -9,4 +9,8 @@
|
|||
* @copyright Bernhard Posselt 2016
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../../../tests/bootstrap.php';
|
||||
require_once __DIR__.'/../../../lib/base.php';
|
||||
require_once __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
\OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
|
||||
\OC_App::loadApp('contacts');
|
||||
|
|
|
@ -1,32 +1,61 @@
|
|||
<?php
|
||||
/**
|
||||
* Nextcloud - contacts
|
||||
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* 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
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @author Hendrik Leppelsack <hendrik@leppelsack.de>
|
||||
* @copyright Hendrik Leppelsack 2015
|
||||
*/
|
||||
|
||||
namespace OCA\Contacts\Controller;
|
||||
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use PHPUnit\Framework\TestCase as Base;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use OCP\IInitialStateService;
|
||||
use OCP\IRequest;
|
||||
use OCP\L10N\IFactory;
|
||||
use ChristophWurst\Nextcloud\Testing\TestCase;
|
||||
|
||||
|
||||
class PageControllerTest extends Base {
|
||||
class PageControllerTest extends TestCase {
|
||||
|
||||
private $controller;
|
||||
|
||||
public function setUp(): void {
|
||||
$config = $this->getMockBuilder('OCP\IConfig')->getMock();
|
||||
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
|
||||
/** @var IRequest|MockObject */
|
||||
private $request;
|
||||
|
||||
/** @var IInitialStateService|MockObject */
|
||||
private $initialStateService;
|
||||
|
||||
/** @var IFactory|MockObject */
|
||||
private $languageFactory;
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->request = $this->createMock(IRequest::class);
|
||||
$this->initialStateService = $this->createMock(IInitialStateService::class);
|
||||
$this->languageFactory = $this->createMock(IFactory::class);
|
||||
|
||||
$this->controller = new PageController(
|
||||
'contacts',
|
||||
$request,
|
||||
$config
|
||||
$this->request,
|
||||
$this->initialStateService,
|
||||
$this->languageFactory
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue