From b0dc21ed0ffd930dae68d87134c804f102daaa5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 6 Feb 2018 11:30:04 +0100 Subject: [PATCH 01/20] Update bootstrap.php --- tests/bootstrap.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index b7f9915b055..536323d49a1 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,14 +1,3 @@ Date: Thu, 29 Mar 2018 12:14:20 +0200 Subject: [PATCH 02/20] Format CSS --- css/firstrunwizard.css | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/css/firstrunwizard.css b/css/firstrunwizard.css index ca85bb99986..37d6ee8e20e 100644 --- a/css/firstrunwizard.css +++ b/css/firstrunwizard.css @@ -19,11 +19,12 @@ width: 16px; position: relative; } + #firstrunwizard .appsmall-calendar, #firstrunwizard .appsmall-contacts { - -ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=65)"; + -ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=65)"" filter: alpha(opacity=65); - opacity: .65; + opacity: 0.65; } #firstrunwizard .button { @@ -33,10 +34,12 @@ #firstrunwizard p a { font-weight: bold; } -#firstrunwizard p a:hover, -#firstrunwizard p a:focus { + +#firstrunwizard p a:focus, +#firstrunwizard p a:hover { color: #444; } + #firstrunwizard .footnote { margin-top: 40px; } @@ -47,6 +50,7 @@ right: 0; padding: 20px; } + #cboxClose { display: none; } From f75884227fe430047fec6e20295087230d5b2a10 Mon Sep 17 00:00:00 2001 From: Felix Heidecke Date: Thu, 29 Mar 2018 12:14:34 +0200 Subject: [PATCH 03/20] Remove -moz-filter (deprecated) --- css/firstrunwizard.css | 1 - 1 file changed, 1 deletion(-) diff --git a/css/firstrunwizard.css b/css/firstrunwizard.css index 37d6ee8e20e..fada696b0f5 100644 --- a/css/firstrunwizard.css +++ b/css/firstrunwizard.css @@ -22,7 +22,6 @@ #firstrunwizard .appsmall-calendar, #firstrunwizard .appsmall-contacts { - -ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=65)"" filter: alpha(opacity=65); opacity: 0.65; } From 2c4de3b659323e83d4969eb2c1ea727bc8a863f4 Mon Sep 17 00:00:00 2001 From: Felix Heidecke Date: Thu, 29 Mar 2018 12:47:45 +0200 Subject: [PATCH 04/20] fix missing googleplay banner --- templates/wizard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/wizard.php b/templates/wizard.php index 6a60f0d437c..5e0d56b9061 100644 --- a/templates/wizard.php +++ b/templates/wizard.php @@ -16,7 +16,7 @@ alt="t('Desktop client'));?>" /> - <?php p($l->t('Android app'));?> From ecda845b1704060319603eacc381220aa65d5b3a Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Sat, 20 Oct 2018 21:24:01 +0200 Subject: [PATCH 05/20] Ready for 10.1 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index bc017af7395..4e8c897bc2c 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -8,7 +8,7 @@ The First run wizard can be customized to meet specific design goals, or to chan AGPL Frank Karlitschek, Jan-Christoph Borchardt - + 1.1 true From 03f5e2638eaa2f03ea238f550a3c1ba7e8389220 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 13 Nov 2018 12:09:53 +0100 Subject: [PATCH 06/20] Set max version to 10 --- appinfo/info.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 4e8c897bc2c..d97f6c7d49d 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -8,9 +8,9 @@ The First run wizard can be customized to meet specific design goals, or to chan AGPL Frank Karlitschek, Jan-Christoph Borchardt - + - 1.1 + 1.1.1 true 166055 From 789db927758a2b379b94012ccf6e9c7e3086e884 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 12 Dec 2018 10:40:18 +0545 Subject: [PATCH 07/20] Standardize CI and move to drone --- .drone.yml | 196 ++++++++++++++++++++ .gitignore | 18 +- .phan/config.php | 109 +++++++++++ .php_cs.dist | 10 + .travis.yml | 2 - Makefile | 154 +++++++++++++++ composer.json | 18 ++ composer.lock | 60 ++++++ phpstan.neon | 4 + phpunit.xml | 25 +++ tests/bootstrap.php | 3 - tests/phpunit.xml | 25 --- vendor-bin/owncloud-codestyle/composer.json | 11 ++ vendor-bin/phan/composer.json | 5 + vendor-bin/phpstan/composer.json | 5 + 15 files changed, 613 insertions(+), 32 deletions(-) create mode 100644 .drone.yml create mode 100644 .phan/config.php create mode 100644 .php_cs.dist create mode 100644 Makefile create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 phpstan.neon create mode 100644 phpunit.xml delete mode 100644 tests/bootstrap.php delete mode 100644 tests/phpunit.xml create mode 100644 vendor-bin/owncloud-codestyle/composer.json create mode 100644 vendor-bin/phan/composer.json create mode 100644 vendor-bin/phpstan/composer.json diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000000..64d1ed347d1 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,196 @@ +workspace: + base: /var/www/owncloud + path: apps/firstrunwizard + +branches: [master, release*, release/*] + +pipeline: + install-core: + image: owncloudci/core + version: ${OC_VERSION} + pull: true + exclude: "apps/firstrunwizard" + db_type: ${DB_TYPE} + db_name: ${DB_NAME} + db_host: ${DB_TYPE} + db_username: autotest + db_password: owncloud + when: + matrix: + NEED_CORE: true + + install-app: + image: owncloudci/php:${PHP_VERSION} + pull: true + commands: + - cd /var/www/owncloud/ + - php occ a:l + - php occ a:e firstrunwizard + - php occ a:e testing + - php occ a:l + - php occ config:system:set trusted_domains 1 --value=owncloud + - php occ log:manage --level 0 + when: + matrix: + NEED_INSTALL_APP: true + + fix-permissions: + image: owncloudci/php:${PHP_VERSION} + pull: true + commands: + - chown www-data /var/www/owncloud -R + - chmod 777 /var/www/owncloud/tests/acceptance/filesForUpload -R + - chmod +x /var/www/owncloud/tests/acceptance/run.sh + when: + matrix: + NEED_SERVER: true + + owncloud-log: + image: owncloud/ubuntu:16.04 + detach: true + pull: true + commands: + - tail -f /var/www/owncloud/data/owncloud.log + when: + matrix: + NEED_SERVER: true + + owncloud-coding-standard: + image: owncloudci/php:${PHP_VERSION} + pull: true + commands: + - make test-php-style + when: + matrix: + TEST_SUITE: owncloud-coding-standard + + phpunit-tests: + image: owncloudci/php:${PHP_VERSION} + pull: true + environment: + - COVERAGE=${COVERAGE} + commands: + - if [ -z "${COVERAGE}" ]; then make test-php-unit; fi + - if [ "${COVERAGE}" = "true" ]; then make test-php-unit-dbg; fi + when: + matrix: + TEST_SUITE: phpunit + + codecov: + image: plugins/codecov:2 + secrets: [codecov_token] + pull: true + paths: + - tests/output/*.xml + when: + matrix: + COVERAGE: true + + notify: + image: plugins/slack:1 + pull: true + secrets: [slack_webhook] + channel: builds + when: + status: [failure, changed] + event: [push, tag] + +services: + mysql: + image: mysql:5.5 + environment: + - MYSQL_USER=autotest + - MYSQL_PASSWORD=owncloud + - MYSQL_DATABASE=${DB_NAME} + - MYSQL_ROOT_PASSWORD=owncloud + when: + matrix: + DB_TYPE: mysql + + pgsql: + image: postgres:9.4 + environment: + - POSTGRES_USER=autotest + - POSTGRES_PASSWORD=owncloud + - POSTGRES_DB=${DB_NAME} + when: + matrix: + DB_TYPE: pgsql + + oci: + image: deepdiver/docker-oracle-xe-11g + environment: + - ORACLE_USER=system + - ORACLE_PASSWORD=oracle + - ORACLE_DB=${DB_NAME} + when: + matrix: + DB_TYPE: oci + + owncloud: + image: owncloudci/php:${PHP_VERSION} + pull: true + environment: + - APACHE_WEBROOT=/var/www/owncloud/ + command: [ "/usr/local/bin/apachectl", "-e", "debug", "-D", "FOREGROUND" ] + when: + matrix: + NEED_SERVER: true + +matrix: + include: + # owncloud-coding-standard + - PHP_VERSION: 7.2 + TEST_SUITE: owncloud-coding-standard + + - PHP_VERSION: 5.6 + TEST_SUITE: owncloud-coding-standard + + # Unit Tests + - PHP_VERSION: 7.1 + OC_VERSION: daily-master-qa + TEST_SUITE: phpunit + DB_TYPE: mysql + DB_NAME: owncloud + NEED_CORE: true + NEED_INSTALL_APP: true + + - PHP_VERSION: 7.2 + OC_VERSION: daily-master-qa + TEST_SUITE: phpunit + DB_TYPE: mysql + DB_NAME: owncloud + NEED_CORE: true + NEED_INSTALL_APP: true + + - PHP_VERSION: 5.6 + OC_VERSION: daily-stable10-qa + TEST_SUITE: phpunit + DB_TYPE: mysql + DB_NAME: owncloud + NEED_CORE: true + NEED_INSTALL_APP: true + + - PHP_VERSION: 7.0 + OC_VERSION: daily-stable10-qa + TEST_SUITE: phpunit + DB_TYPE: mysql + DB_NAME: owncloud + NEED_CORE: true + NEED_INSTALL_APP: true + + - PHP_VERSION: 7.1 + OC_VERSION: daily-stable10-qa + TEST_SUITE: phpunit + DB_TYPE: mysql + DB_NAME: owncloud + NEED_CORE: true + NEED_INSTALL_APP: true + + - PHP_VERSION: 7.2 + OC_VERSION: daily-stable10-qa + TEST_SUITE: phpunit + DB_TYPE: mysql + DB_NAME: owncloud + NEED_CORE: true + NEED_INSTALL_APP: true diff --git a/.gitignore b/.gitignore index 9ae0879d2fe..178467ff314 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,16 @@ -# test coverage -tests/clover.xml +# build dir +/build/ +/l10n/.transifexrc +.php_cs.cache + +# Composer +vendor/ +vendor-bin/**/vendor +vendor-bin/**/composer.lock + +# Mac OS +.DS_Store + +# Tests - auto-generated files +/tests/acceptance/output +/tests/output diff --git a/.phan/config.php b/.phan/config.php new file mode 100644 index 00000000000..6004d6e189f --- /dev/null +++ b/.phan/config.php @@ -0,0 +1,109 @@ + + * + * @copyright Copyright (c) 2018, ownCloud GmbH + * @license GPL-2.0 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 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 General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +return [ + + // Supported values: '7.0', '7.1', '7.2', null. + // If this is set to null, + // then Phan assumes the PHP version which is closest to the minor version + // of the php executable used to execute phan. + 'target_php_version' => null, + + // A list of directories that should be parsed for class and + // method information. After excluding the directories + // defined in exclude_analysis_directory_list, the remaining + // files will be statically analyzed for errors. + // + // Thus, both first-party and third-party code being used by + // your application should be included in this list. + 'directory_list' => [ + 'appinfo', + 'lib', + 'vendor', + '../../lib', + '../../core' + ], + + // A directory list that defines files that will be excluded + // from static analysis, but whose class and method + // information should be included. + // + // Generally, you'll want to include the directories for + // third-party code (such as "vendor/") in this list. + // + // n.b.: If you'd like to parse but not analyze 3rd + // party code, directories containing that code + // should be added to both the `directory_list` + // and `exclude_analysis_directory_list` arrays. + 'exclude_analysis_directory_list' => [ + 'vendor', + '../../lib', + '../../core' + ], + + // A regular expression to match files to be excluded + // from parsing and analysis and will not be read at all. + // + // This is useful for excluding groups of test or example + // directories/files, unanalyzable files, or files that + // can't be removed for whatever reason. + // (e.g. '@Test\.php$@', or '@vendor/.*/(tests|Tests)/@') + 'exclude_file_regex' => '@.*/[^/]*(tests|Tests|templates)/@', + + // If true, missing properties will be created when + // they are first seen. If false, we'll report an + // error message. + "allow_missing_properties" => false, + + // If enabled, allow null to be cast as any array-like type. + // This is an incremental step in migrating away from null_casts_as_any_type. + // If null_casts_as_any_type is true, this has no effect. + "null_casts_as_any_type" => true, + + // Backwards Compatibility Checking. This is slow + // and expensive, but you should consider running + // it before upgrading your version of PHP to a + // new version that has backward compatibility + // breaks. + 'backward_compatibility_checks' => false, + + // The initial scan of the function's code block has no + // type information for `$arg`. It isn't until we see + // the call and rescan test()'s code block that we can + // detect that it is actually returning the passed in + // `string` instead of an `int` as declared. + 'quick_mode' => false, + + // The minimum severity level to report on. This can be + // set to Issue::SEVERITY_LOW, Issue::SEVERITY_NORMAL or + // Issue::SEVERITY_CRITICAL. Setting it to only + // critical issues is a good place to start on a big + // sloppy mature code base. + 'minimum_severity' => 5, + + // A set of fully qualified class-names for which + // a call to parent::__construct() is required + 'parent_constructor_required' => [ + ], + +]; \ No newline at end of file diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 00000000000..a3540ef1c55 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,10 @@ +setUsingCache(true) + ->getFinder() + ->exclude('vendor') + ->exclude('vendor-bin') + ->exclude('l10n') + ->in(__DIR__); + return $config; diff --git a/.travis.yml b/.travis.yml index cd2a44e559e..d779e71ec6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,6 @@ branches: - master - /^stable\d+(\.\d+)?$/ - before_install: - wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB @@ -28,7 +27,6 @@ before_script: - cd apps/$APP_NAME/ script: - - cd tests - phpunit --configuration phpunit.xml matrix: diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..d3976b389f4 --- /dev/null +++ b/Makefile @@ -0,0 +1,154 @@ +# Makefile for building the project + +SHELL := /bin/bash + +COMPOSER_BIN := $(shell command -v composer 2> /dev/null) +ifndef COMPOSER_BIN + $(error composer is not available on your system, please install composer) +endif + +app_name=firstrunwizard +project_directory=$(CURDIR)/../$(app_name) +build_tools_directory=$(CURDIR)/build/tools +source_build_directory=$(CURDIR)/build/artifacts/source +source_package_name=$(source_build_directory)/$(app_name) +appstore_build_directory=$(CURDIR)/build/artifacts/appstore +appstore_package_name=$(appstore_build_directory)/$(app_name) + +# signing +occ=$(CURDIR)/../../occ +private_key=$(HOME)/.owncloud/certificates/$(app_name).key +certificate=$(HOME)/.owncloud/certificates/$(app_name).crt +sign=php -f $(occ) integrity:sign-app --privateKey="$(private_key)" --certificate="$(certificate)" +sign_skip_msg="Skipping signing, either no key and certificate found in $(private_key) and $(certificate) or occ can not be found at $(occ)" + +ifneq (,$(wildcard $(private_key))) +ifneq (,$(wildcard $(certificate))) +ifneq (,$(wildcard $(occ))) + CAN_SIGN=true +endif +endif +endif + +# bin file definitions +PHPUNIT=php -d zend.enable_gc=0 "$(PWD)/../../lib/composer/bin/phpunit" +PHPUNITDBG=phpdbg -qrr -d memory_limit=4096M -d zend.enable_gc=0 "$(PWD)/../../lib/composer/bin/phpunit" +PHP_CS_FIXER=php -d zend.enable_gc=0 vendor-bin/owncloud-codestyle/vendor/bin/php-cs-fixer +PHAN=php -d zend.enable_gc=0 vendor-bin/phan/vendor/bin/phan +PHPSTAN=php -d zend.enable_gc=0 vendor-bin/phpstan/vendor/bin/phpstan + +all: appstore + +.PHONY: clean +clean: + rm -rf ./build/artifacts + +# Builds the source and appstore package +.PHONY: dist +dist: source appstore + +# Builds the source package +.PHONY: source +source: + rm -rf $(source_build_directory) + mkdir -p $(source_build_directory) + tar cvzf $(source_package_name).tar.gz ../$(app_name) \ + --exclude-vcs \ + --exclude="../$(app_name)/build" \ + --exclude="../$(app_name)/*.log" + +# Builds the source package for the app store, ignores php and js tests +.PHONY: appstore +appstore: + rm -rf $(appstore_build_directory) + mkdir -p $(appstore_package_name) + cp --parents -r \ + ajax \ + appinfo \ + css \ + img \ + js \ + l10n \ + lib \ + templates \ + COPYING \ + CHANGELOG.md \ + wizard.php \ + $(appstore_package_name) + +ifdef CAN_SIGN + $(sign) --path="$(appstore_package_name)" +else + @echo $(sign_skip_msg) +endif + tar -czf $(appstore_package_name).tar.gz -C $(appstore_package_name)/../ $(app_name) + +##--------------------- +## Tests +##--------------------- + +.PHONY: test-php-unit +test-php-unit: ## Run php unit tests +test-php-unit: + $(PHPUNIT) --configuration ./phpunit.xml --testsuite unit + +.PHONY: test-php-unit-dbg +test-php-unit-dbg: ## Run php unit tests using phpdbg +test-php-unit-dbg: + $(PHPUNITDBG) --configuration ./phpunit.xml --testsuite unit + +.PHONY: test-php-style +test-php-style: ## Run php-cs-fixer and check owncloud code-style +test-php-style: vendor-bin/owncloud-codestyle/vendor + $(PHP_CS_FIXER) fix -v --diff --diff-format udiff --allow-risky yes --dry-run + +.PHONY: test-php-style-fix +test-php-style-fix: ## Run php-cs-fixer and fix code style issues +test-php-style-fix: vendor-bin/owncloud-codestyle/vendor + $(PHP_CS_FIXER) fix -v --diff --diff-format udiff --allow-risky yes + +.PHONY: test-php-phan +test-php-phan: ## Run phan +test-php-phan: vendor-bin/phan/vendor + $(PHAN) --config-file .phan/config.php --require-config-exists + +.PHONY: test-php-phpstan +test-php-phpstan: ## Run phpstan +test-php-phpstan: vendor-bin/phpstan/vendor + $(PHPSTAN) analyse --memory-limit=4G --configuration=./phpstan.neon --no-progress --level=5 appinfo lib + +.PHONY: test-acceptance-webui +test-acceptance-webui: ## Run webUI acceptance tests +test-acceptance-webui: + ../../tests/acceptance/run.sh --remote --type webUI + +# +# Dependency management +#-------------------------------------- + +composer.lock: composer.json + @echo composer.lock is not up to date. + +vendor: composer.lock + composer install --no-dev + +vendor/bamarni/composer-bin-plugin: composer.lock + composer install + +vendor-bin/owncloud-codestyle/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/owncloud-codestyle/composer.lock + composer bin owncloud-codestyle install --no-progress + +vendor-bin/owncloud-codestyle/composer.lock: vendor-bin/owncloud-codestyle/composer.json + @echo owncloud-codestyle composer.lock is not up to date. + +vendor-bin/phan/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/phan/composer.lock + composer bin phan install --no-progress + +vendor-bin/phan/composer.lock: vendor-bin/phan/composer.json + @echo phan composer.lock is not up to date. + +vendor-bin/phpstan/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/phpstan/composer.lock + composer bin phpstan install --no-progress + +vendor-bin/phpstan/composer.lock: vendor-bin/phpstan/composer.json + @echo phpstan composer.lock is not up to date. diff --git a/composer.json b/composer.json new file mode 100644 index 00000000000..9678de65179 --- /dev/null +++ b/composer.json @@ -0,0 +1,18 @@ +{ + "name": "owncloud/firstrunwizard", + "config" : { + "platform": { + "php": "5.6.37" + } + }, + "require": { + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2" + }, + "extra": { + "bamarni-bin": { + "bin-links": false + } + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 00000000000..dc217edd211 --- /dev/null +++ b/composer.lock @@ -0,0 +1,60 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "41ca90ec5e3e06e691ff177b6852cee7", + "packages": [], + "packages-dev": [ + { + "name": "bamarni/composer-bin-plugin", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/bamarni/composer-bin-plugin.git", + "reference": "62fef740245a85f00665e81ea8f0aa0b72afe6e7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/62fef740245a85f00665e81ea8f0aa0b72afe6e7", + "reference": "62fef740245a85f00665e81ea8f0aa0b72afe6e7", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "require-dev": { + "composer/composer": "dev-master", + "symfony/console": "^2.5 || ^3.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Bamarni\\Composer\\Bin\\Plugin", + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Bamarni\\Composer\\Bin\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "time": "2017-09-11T13:13:58+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "platform-overrides": { + "php": "5.6.37" + } +} diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000000..fc21becb2a3 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,4 @@ +parameters: + bootstrap: %currentWorkingDirectory%/../../lib/base.php + ignoreErrors: + diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 00000000000..1f0b00f4476 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,25 @@ + + + + ./tests + + + + + . + + ./l10n + ./tests + + + + + + + + diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index 536323d49a1..00000000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,3 +0,0 @@ - - - - . - - - - - ../firstrunwizard - - ../firstrunwizard/l10n - ../firstrunwizard/tests - - - - - - - - \ No newline at end of file diff --git a/vendor-bin/owncloud-codestyle/composer.json b/vendor-bin/owncloud-codestyle/composer.json new file mode 100644 index 00000000000..73bdb773f73 --- /dev/null +++ b/vendor-bin/owncloud-codestyle/composer.json @@ -0,0 +1,11 @@ +{ + "config" : { + "platform": { + "php": "5.6.37" + } + }, + "require": { + "owncloud/coding-standard": "^1.0" + } + } + \ No newline at end of file diff --git a/vendor-bin/phan/composer.json b/vendor-bin/phan/composer.json new file mode 100644 index 00000000000..b8f6ca70c58 --- /dev/null +++ b/vendor-bin/phan/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "phan/phan": "^1.0.0" + } +} diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json new file mode 100644 index 00000000000..cb0a62328e1 --- /dev/null +++ b/vendor-bin/phpstan/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "phpstan/phpstan": "^0.10.2" + } +} From d762a6352ca68b2de633a102797aa5b02832154e Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 12 Dec 2018 11:22:14 +0545 Subject: [PATCH 08/20] code style changes --- appinfo/app.php | 15 +++++++-------- appinfo/routes.php | 1 - lib/config.php | 3 +-- lib/util.php | 7 +++---- templates/wizard.php | 6 +++--- tests/lib/utiltest.php | 3 +-- wizard.php | 2 +- 7 files changed, 16 insertions(+), 21 deletions(-) diff --git a/appinfo/app.php b/appinfo/app.php index 8f25372a10b..bb579fa4c39 100755 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -4,20 +4,20 @@ * * @author Frank Karlitschek * @copyright 2012 Frank Karlitschek karlitschek@kde.org - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE - * License as published by the Free Software Foundation; either + * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. - * + * * This library 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 library. If not, see . - * + * */ namespace OCA\FirstRunWizard; @@ -32,14 +32,13 @@ $eventDispatcher = \OC::$server->getEventDispatcher(); $eventDispatcher->addListener( 'OCA\Files::loadAdditionalScripts', - function() { + function () { $config = \OC::$server->getConfig(); $userSession = \OC::$server->getUserSession(); $firstRunConfig = new Config($config, $userSession); if ($userSession->isLoggedIn() && $firstRunConfig->isEnabled()) { - Util::addScript( 'firstrunwizard', 'activate'); + Util::addScript('firstrunwizard', 'activate'); } } ); - diff --git a/appinfo/routes.php b/appinfo/routes.php index eb9c5b005d8..df00dc76730 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -14,4 +14,3 @@ ->actionInclude('firstrunwizard/ajax/disable.php'); $this->create('firstrunwizard_wizard', 'wizard.php') ->actionInclude('firstrunwizard/wizard.php'); - diff --git a/lib/config.php b/lib/config.php index e04089104bf..88c565b4b59 100755 --- a/lib/config.php +++ b/lib/config.php @@ -26,7 +26,6 @@ use OCP\IUserSession; class Config { - protected $config; protected $userSession; @@ -68,7 +67,7 @@ public function isEnabled() { $user = $this->userSession->getUser(); if ($user) { $conf = $this->config->getUserValue($user->getUID(), 'firstrunwizard', 'show', 1); - return (intval($conf) === 1); + return (\intval($conf) === 1); } else { return false; } diff --git a/lib/util.php b/lib/util.php index c7db402dc70..bd582e5f4ee 100644 --- a/lib/util.php +++ b/lib/util.php @@ -27,7 +27,6 @@ use OCP\IConfig; class Util { - protected $appManager; protected $config; @@ -46,7 +45,7 @@ public function __construct(IAppManager $appManager, IConfig $config, Defaults $ } /** - * \OC_Util::getEditionString() from global namespace + * \OC_Util::getEditionString() from global namespace * (core:lib/private/legacy/util.php) * @return string */ @@ -58,10 +57,10 @@ public function getEdition() { * @return array */ public function getSyncClientUrls() { - return array( + return [ 'desktop' => $this->config->getSystemValue('customclient_desktop', $this->defaults->getSyncClientUrl()), 'android' => $this->config->getSystemValue('customclient_android', $this->defaults->getAndroidClientUrl()), 'ios' => $this->config->getSystemValue('customclient_ios', $this->defaults->getiOSClientUrl()) - ); + ]; } } diff --git a/templates/wizard.php b/templates/wizard.php index 5e0d56b9061..e1c8ff671e7 100644 --- a/templates/wizard.php +++ b/templates/wizard.php @@ -25,7 +25,7 @@ -

t('Connect your desktop apps to %s', array($theme->getName()))); ?>

+

t('Connect your desktop apps to %s', [$theme->getName()])); ?>

@@ -50,7 +50,7 @@

-t('There’s more information in the documentation and on our website.', array(link_to_docs('user_manual')))); ?>
+t('There’s more information in the documentation and on our website.', [link_to_docs('user_manual')])); ?>
t('If you like ownCloud, spread the word!')); ?> getEntity()); ?> getEntity()); ?>

diff --git a/tests/lib/utiltest.php b/tests/lib/utiltest.php index 8d89a1fcd5b..c0c1c6c9def 100644 --- a/tests/lib/utiltest.php +++ b/tests/lib/utiltest.php @@ -11,10 +11,9 @@ class UtilTest extends \PHPUnit_Framework_TestCase { */ public function testGetEditionString() { $edition = \OC_Util::getEditionString(); - $this->assertTrue(is_string($edition)); + $this->assertTrue(\is_string($edition)); } - /** * @dataProvider getSyncClientUrlsData */ diff --git a/wizard.php b/wizard.php index e412371c027..31a17cd5a29 100644 --- a/wizard.php +++ b/wizard.php @@ -37,7 +37,7 @@ $util = new Util($appManager, $config, $defaults); $tmpl = new Template('firstrunwizard', 'wizard', ''); -$tmpl->assign('logo', CoreUtil::linkTo('core','img/logo-inverted.svg')); +$tmpl->assign('logo', CoreUtil::linkTo('core', 'img/logo-inverted.svg')); $tmpl->assign('clients', $util->getSyncClientUrls()); $tmpl->assign('edition', $util->getEdition()); $tmpl->printPage(); From d1fd4cbbe22f718ec956cf14711785b50805103d Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 12 Dec 2018 12:08:57 +0545 Subject: [PATCH 09/20] Remove travis --- .travis.yml | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d779e71ec6d..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: php -php: - - 5.6 - - 7 - -env: - global: - - CORE_BRANCH=master - - APP_NAME=firstrunwizard - matrix: - - DB=sqlite - -branches: - only: - - master - - /^stable\d+(\.\d+)?$/ - -before_install: - - wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh - - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - - # Add some output debugging information - - cd ../core - - ./occ app:enable firstrunwizard - -before_script: - - cd apps/$APP_NAME/ - -script: - - phpunit --configuration phpunit.xml - -matrix: - fast_finish: true From dc52eee82cbe4c39bfbbe9f458529cc13a3c3a24 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 13 Dec 2018 10:44:39 +0545 Subject: [PATCH 10/20] Adjust build status badge for drone --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cbfd337e64a..1da4fea6118 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,4 @@ firstrunwizard A first run wizard that explains the usage of ownCloud to new users -[![Build Status](https://travis-ci.org/owncloud/firstrunwizard.svg?branch=master)](https://travis-ci.org/owncloud/firstrunwizard) +[![Build Status](https://drone.owncloud.com/api/badges/owncloud/firstrunwizard/status.svg?branch=master)](https://drone.owncloud.com/owncloud/firstrunwizard) From beb0e89096674ac6f85ba1ab3ed6181830634e53 Mon Sep 17 00:00:00 2001 From: Dipak Acharya Date: Wed, 19 Dec 2018 16:05:39 +0545 Subject: [PATCH 11/20] Add codecoverage in drone --- .drone.yml | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 64d1ed347d1..af5f16830da 100644 --- a/.drone.yml +++ b/.drone.yml @@ -186,6 +186,7 @@ matrix: DB_NAME: owncloud NEED_CORE: true NEED_INSTALL_APP: true + COVERAGE: true - PHP_VERSION: 7.2 OC_VERSION: daily-stable10-qa diff --git a/README.md b/README.md index 1da4fea6118..8cb9efb6975 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,4 @@ firstrunwizard A first run wizard that explains the usage of ownCloud to new users -[![Build Status](https://drone.owncloud.com/api/badges/owncloud/firstrunwizard/status.svg?branch=master)](https://drone.owncloud.com/owncloud/firstrunwizard) +[![Build Status](https://drone.owncloud.com/api/badges/owncloud/firstrunwizard/status.svg?branch=master)](https://drone.owncloud.com/owncloud/firstrunwizard) [![codecov](https://codecov.io/gh/owncloud/firstrunwizard/branch/master/graph/badge.svg)](https://codecov.io/gh/owncloud/firstrunwizard) From e5bde7805d6f0f98ad0db2b782093629af6bc7cb Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Fri, 28 Dec 2018 17:39:28 +0545 Subject: [PATCH 12/20] Do not pin coding-standard to PHP 5.6 --- vendor-bin/owncloud-codestyle/composer.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/vendor-bin/owncloud-codestyle/composer.json b/vendor-bin/owncloud-codestyle/composer.json index 73bdb773f73..da455d6b7e3 100644 --- a/vendor-bin/owncloud-codestyle/composer.json +++ b/vendor-bin/owncloud-codestyle/composer.json @@ -1,9 +1,4 @@ { - "config" : { - "platform": { - "php": "5.6.37" - } - }, "require": { "owncloud/coding-standard": "^1.0" } From b956cc0baf3809421dcc5e8ded642f432137ff81 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 21 Feb 2019 12:54:46 +0545 Subject: [PATCH 13/20] Run drone on stable10 --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index af5f16830da..6c0a49e58f0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,7 +2,7 @@ workspace: base: /var/www/owncloud path: apps/firstrunwizard -branches: [master, release*, release/*] +branches: [master, release*, release/*, stable10] pipeline: install-core: From b7501fa9f97b3b833a65b3bf3ffba46e34765127 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 21 Feb 2019 12:56:33 +0545 Subject: [PATCH 14/20] Fix code style in stable10 --- tests/lib/configtest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/configtest.php b/tests/lib/configtest.php index 6cfa4a12e78..64722d1319b 100644 --- a/tests/lib/configtest.php +++ b/tests/lib/configtest.php @@ -157,4 +157,4 @@ public function isEnabledData() { [null], ]; } -} \ No newline at end of file +} From e0611449a9e603e26994b83f42ef4af7d800aeb0 Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Fri, 9 Nov 2018 13:03:47 +0000 Subject: [PATCH 15/20] Add occ command to reset for all users --- appinfo/info.xml | 4 ++ lib/Command/ResetAll.php | 80 ++++++++++++++++++++++++++++++++++++++++ lib/config.php | 35 +++++++++++++++++- tests/lib/configtest.php | 80 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 lib/Command/ResetAll.php diff --git a/appinfo/info.xml b/appinfo/info.xml index d97f6c7d49d..01795683b3b 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -11,7 +11,11 @@ The First run wizard can be customized to meet specific design goals, or to chan 1.1.1 + FirstRunWizard true 166055 + + OCA\FirstRunWizard\Command\ResetAll + diff --git a/lib/Command/ResetAll.php b/lib/Command/ResetAll.php new file mode 100644 index 00000000000..3af548f6cdf --- /dev/null +++ b/lib/Command/ResetAll.php @@ -0,0 +1,80 @@ + +* +* @copyright Copyright (c) 2019, ownCloud GmbH +* @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\FirstRunWizard\Command; + +use OCA\FirstRunWizard\Config; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Helper\ProgressBar; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * Class ResetAll + * + * @package OCA\FirstRunWizard\Command + */ +class ResetAll extends Command { + /** + * @var Config + */ + protected $config; + + /** + * ResetAll constructor. + * + * @param Config $config + */ + public function __construct(Config $config) { + parent::__construct(); + $this->config = $config; + } + + /** + * Setup the command + * + * @return int|null|void + */ + public function configure() { + $this + ->setName('firstrunwizard:reset-all') + ->setDescription('Reset the first run wizard for all users'); + } + + /** + * Execute the command + * + * @param InputInterface $input + * @param OutputInterface $output + * + * @return int|null|void + */ + public function execute(InputInterface $input, OutputInterface $output) { + $output->writeln('Resetting firstrunwizard for all users'); + $progress = new ProgressBar($output); + $this->config->resetAllUsers(function ($user) use ($progress) { + $progress->advance(); + }); + $progress->finish(); + $output->writeln(""); + $output->writeln("Done"); + } +} diff --git a/lib/config.php b/lib/config.php index 88c565b4b59..42e622e3bee 100755 --- a/lib/config.php +++ b/lib/config.php @@ -1,5 +1,4 @@ . * */ + namespace OCA\FirstRunWizard; use OCP\IConfig; use OCP\IUserSession; +/** + * Class Config + * + * @package OCA\FirstRunWizard + */ class Config { + + /** + * @var IConfig + */ protected $config; + /** + * @var IUserSession + */ protected $userSession; /** @@ -72,4 +84,25 @@ public function isEnabled() { return false; } } + + /** + * Enables the firstrunwizard for all users again that had it disabled + * + * @param callable $callback called with the current user being set + * + * @return void + * + * @throws \OCP\PreConditionNotMetException + */ + public function resetAllUsers(callable $callback) { + $users = $this->config->getUsersForUserValue( + 'firstrunwizard', + 'show', + 0 + ); + foreach ($users as $user) { + \call_user_func($callback, $user); + $this->config->setUserValue($user, 'firstrunwizard', 'show', 1); + } + } } diff --git a/tests/lib/configtest.php b/tests/lib/configtest.php index 64722d1319b..8131d6f1a61 100644 --- a/tests/lib/configtest.php +++ b/tests/lib/configtest.php @@ -4,14 +4,29 @@ use OCA\FirstRunWizard\Config; +/** + * Class ConfigTest + * + * @package OCA\FirstRunWizard\Tests + */ class ConfigTest extends \PHPUnit_Framework_TestCase { /** + * @param bool $isUserAvailable + * * @dataProvider enableDisableData + * + * @return void */ public function testEnable($isUserAvailable) { + /** + * @var IConfig | \PHPUnit_Framework_MockObject_MockObject $config + */ $config = $this->getMockBuilder('\OCP\IConfig') ->disableOriginalConstructor()->getMock(); + /** + * @var IUserSession | \PHPUnit_Framework_MockObject_MockObject $userSession + */ $userSession = $this->getMockBuilder('\OCP\IUserSession') ->disableOriginalConstructor()->getMock(); $user = $this->getMockBuilder('\OCP\IUser') @@ -47,11 +62,21 @@ public function testEnable($isUserAvailable) { } /** + * @param bool $isUserAvailable + * + * @return void + * * @dataProvider enableDisableData */ public function testDisable($isUserAvailable) { + /** + * @var IConfig | \PHPUnit_Framework_MockObject_MockObject $config + */ $config = $this->getMockBuilder('\OCP\IConfig') ->disableOriginalConstructor()->getMock(); + /** + * @var IUserSession | \PHPUnit_Framework_MockObject_MockObject $userSession + */ $userSession = $this->getMockBuilder('\OCP\IUserSession') ->disableOriginalConstructor()->getMock(); $user = $this->getMockBuilder('\OCP\IUser') @@ -86,6 +111,9 @@ public function testDisable($isUserAvailable) { } } + /** + * @return array + */ public function enableDisableData() { return [ [true], @@ -94,11 +122,21 @@ public function enableDisableData() { } /** + * @param bool $isEnabled + * + * @return void + * * @dataProvider isEnabledData */ public function testIsEnabled($isEnabled) { + /** + * @var IConfig | \PHPUnit_Framework_MockObject_MockObject $config + */ $config = $this->getMockBuilder('\OCP\IConfig') ->disableOriginalConstructor()->getMock(); + /** + * @var IUserSession | \PHPUnit_Framework_MockObject_MockObject $userSession + */ $userSession = $this->getMockBuilder('\OCP\IUserSession') ->disableOriginalConstructor()->getMock(); $user = $this->getMockBuilder('\OCP\IUser') @@ -150,6 +188,9 @@ public function testIsEnabled($isEnabled) { } } + /** + * @return array + */ public function isEnabledData() { return [ [true], @@ -157,4 +198,43 @@ public function isEnabledData() { [null], ]; } + + /** + * Test that the config is reset for all users + * + * @return void + * + * @throws \OCP\PreConditionNotMetException + */ + public function testResetAllUsers() { + $users = []; + $users[] = $this->getMockBuilder('\OCP\IUser') + ->disableOriginalConstructor()->getMock(); + $users[] = $this->getMockBuilder('\OCP\IUser') + ->disableOriginalConstructor()->getMock(); + /** + * @var IConfig | \PHPUnit_Framework_MockObject_MockObject $config + */ + $config = $this->getMockBuilder('\OCP\IConfig') + ->disableOriginalConstructor()->getMock(); + $config->method('getUsersForUserValue') + ->with('firstrunwizard', 'show', 0) + ->willReturn($users); + $config->expects($this->exactly(\count($users))) + ->method('setUserValue'); + /** + * @var IUserSession | \PHPUnit_Framework_MockObject_MockObject $userSession + */ + $userSession = $this->getMockBuilder('\OCP\IUserSession') + ->disableOriginalConstructor()->getMock(); + $c = new Config($config, $userSession); + // Create a fake callback to check it gets called + $mock = $this->getMockBuilder('stdClass'); + $mock->setMethods(['callback']); + $mock = $mock->getMock(); + $mock->expects($this->exactly(\count($users))) + ->method('callback') + ->will($this->returnValue(true)); + $c->resetAllUsers([$mock, 'callback']); + } } From b359bac59a7273e011b519a0972e3629f05c0db0 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 13 Mar 2019 09:58:43 +0545 Subject: [PATCH 16/20] Drop PHP 5.6 --- .drone.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6c0a49e58f0..523f6ebd151 100644 --- a/.drone.yml +++ b/.drone.yml @@ -143,7 +143,7 @@ matrix: - PHP_VERSION: 7.2 TEST_SUITE: owncloud-coding-standard - - PHP_VERSION: 5.6 + - PHP_VERSION: 7.0 TEST_SUITE: owncloud-coding-standard # Unit Tests @@ -163,14 +163,6 @@ matrix: NEED_CORE: true NEED_INSTALL_APP: true - - PHP_VERSION: 5.6 - OC_VERSION: daily-stable10-qa - TEST_SUITE: phpunit - DB_TYPE: mysql - DB_NAME: owncloud - NEED_CORE: true - NEED_INSTALL_APP: true - - PHP_VERSION: 7.0 OC_VERSION: daily-stable10-qa TEST_SUITE: phpunit From c55a2be104c53d6c94bba7664340e3f44410dc9d Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 13 Mar 2019 20:13:09 +0545 Subject: [PATCH 17/20] Adjust composer files and app core min-version for 'drop PHP 5.6' --- composer.json | 2 +- composer.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 9678de65179..50eaed3cff3 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "owncloud/firstrunwizard", "config" : { "platform": { - "php": "5.6.37" + "php": "7.0.8" } }, "require": { diff --git a/composer.lock b/composer.lock index dc217edd211..b9e1160017c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "41ca90ec5e3e06e691ff177b6852cee7", + "content-hash": "0b53c9e5d38ed856b8838d76abdbe034", "packages": [], "packages-dev": [ { @@ -55,6 +55,6 @@ "platform": [], "platform-dev": [], "platform-overrides": { - "php": "5.6.37" + "php": "7.0.8" } } From 4b4cb3cf71a10e86d95093a81b88aa1d70a666a8 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 3 Apr 2019 07:30:53 +0545 Subject: [PATCH 18/20] Updating bamarni/composer-bin-plugin (v1.2.0 => v1.3.0) --- composer.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.lock b/composer.lock index b9e1160017c..a8c243c6aae 100644 --- a/composer.lock +++ b/composer.lock @@ -1,7 +1,7 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "0b53c9e5d38ed856b8838d76abdbe034", @@ -9,16 +9,16 @@ "packages-dev": [ { "name": "bamarni/composer-bin-plugin", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/bamarni/composer-bin-plugin.git", - "reference": "62fef740245a85f00665e81ea8f0aa0b72afe6e7" + "reference": "67f9d314dc7ecf7245b8637906e151ccc62b8d24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/62fef740245a85f00665e81ea8f0aa0b72afe6e7", - "reference": "62fef740245a85f00665e81ea8f0aa0b72afe6e7", + "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/67f9d314dc7ecf7245b8637906e151ccc62b8d24", + "reference": "67f9d314dc7ecf7245b8637906e151ccc62b8d24", "shasum": "" }, "require": { @@ -26,7 +26,7 @@ }, "require-dev": { "composer/composer": "dev-master", - "symfony/console": "^2.5 || ^3.0" + "symfony/console": "^2.5 || ^3.0 || ^4.0" }, "type": "composer-plugin", "extra": { @@ -44,7 +44,7 @@ "license": [ "MIT" ], - "time": "2017-09-11T13:13:58+00:00" + "time": "2019-03-17T12:38:04+00:00" } ], "aliases": [], From 5ad74eaafffe7fabe6abdc72e885569c22acb098 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 2 Apr 2019 12:09:21 +0545 Subject: [PATCH 19/20] Adjust PHPUnit Framework namespace for PHPUnit6 --- tests/lib/configtest.php | 18 +++++++++--------- tests/lib/utiltest.php | 4 +++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/lib/configtest.php b/tests/lib/configtest.php index 8131d6f1a61..6929f7bacb1 100644 --- a/tests/lib/configtest.php +++ b/tests/lib/configtest.php @@ -9,7 +9,7 @@ * * @package OCA\FirstRunWizard\Tests */ -class ConfigTest extends \PHPUnit_Framework_TestCase { +class ConfigTest extends \PHPUnit\Framework\TestCase { /** * @param bool $isUserAvailable @@ -20,12 +20,12 @@ class ConfigTest extends \PHPUnit_Framework_TestCase { */ public function testEnable($isUserAvailable) { /** - * @var IConfig | \PHPUnit_Framework_MockObject_MockObject $config + * @var IConfig | \PHPUnit\Framework\MockObject\MockObject $config */ $config = $this->getMockBuilder('\OCP\IConfig') ->disableOriginalConstructor()->getMock(); /** - * @var IUserSession | \PHPUnit_Framework_MockObject_MockObject $userSession + * @var IUserSession | \PHPUnit\Framework\MockObject\MockObject $userSession */ $userSession = $this->getMockBuilder('\OCP\IUserSession') ->disableOriginalConstructor()->getMock(); @@ -70,12 +70,12 @@ public function testEnable($isUserAvailable) { */ public function testDisable($isUserAvailable) { /** - * @var IConfig | \PHPUnit_Framework_MockObject_MockObject $config + * @var IConfig | \PHPUnit\Framework\MockObject\MockObject $config */ $config = $this->getMockBuilder('\OCP\IConfig') ->disableOriginalConstructor()->getMock(); /** - * @var IUserSession | \PHPUnit_Framework_MockObject_MockObject $userSession + * @var IUserSession | \PHPUnit\Framework\MockObject\MockObject $userSession */ $userSession = $this->getMockBuilder('\OCP\IUserSession') ->disableOriginalConstructor()->getMock(); @@ -130,12 +130,12 @@ public function enableDisableData() { */ public function testIsEnabled($isEnabled) { /** - * @var IConfig | \PHPUnit_Framework_MockObject_MockObject $config + * @var IConfig | \PHPUnit\Framework\MockObject\MockObject $config */ $config = $this->getMockBuilder('\OCP\IConfig') ->disableOriginalConstructor()->getMock(); /** - * @var IUserSession | \PHPUnit_Framework_MockObject_MockObject $userSession + * @var IUserSession | \PHPUnit\Framework\MockObject\MockObject $userSession */ $userSession = $this->getMockBuilder('\OCP\IUserSession') ->disableOriginalConstructor()->getMock(); @@ -213,7 +213,7 @@ public function testResetAllUsers() { $users[] = $this->getMockBuilder('\OCP\IUser') ->disableOriginalConstructor()->getMock(); /** - * @var IConfig | \PHPUnit_Framework_MockObject_MockObject $config + * @var IConfig | \PHPUnit\Framework\MockObject\MockObject $config */ $config = $this->getMockBuilder('\OCP\IConfig') ->disableOriginalConstructor()->getMock(); @@ -223,7 +223,7 @@ public function testResetAllUsers() { $config->expects($this->exactly(\count($users))) ->method('setUserValue'); /** - * @var IUserSession | \PHPUnit_Framework_MockObject_MockObject $userSession + * @var IUserSession | \PHPUnit\Framework\MockObject\MockObject $userSession */ $userSession = $this->getMockBuilder('\OCP\IUserSession') ->disableOriginalConstructor()->getMock(); diff --git a/tests/lib/utiltest.php b/tests/lib/utiltest.php index c0c1c6c9def..87536cab6c0 100644 --- a/tests/lib/utiltest.php +++ b/tests/lib/utiltest.php @@ -4,7 +4,7 @@ use OCA\FirstRunWizard\Util; -class UtilTest extends \PHPUnit_Framework_TestCase { +class UtilTest extends \PHPUnit\Framework\TestCase { /** * same code as in core: tests/lib/UtilTest.php @@ -20,8 +20,10 @@ public function testGetEditionString() { public function testGetSyncClientUrls($configValues, $defaultValues) { $appManager = $this->getMockBuilder('\OCP\App\IAppManager') ->disableOriginalConstructor()->getMock(); + /** @var IConfig | \PHPUnit\Framework\MockObject\MockObject $config */ $config = $this->getMockBuilder('\OCP\IConfig') ->disableOriginalConstructor()->getMock(); + /** @var Defaults | \PHPUnit\Framework\MockObject\MockObject $defaults */ $defaults = $this->getMockBuilder('\OCP\Defaults') ->disableOriginalConstructor()->getMock(); From 7f56836c9ae20d24e6692bb3085160df4cf08c34 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 2 Apr 2019 12:10:27 +0545 Subject: [PATCH 20/20] phpunit enable failOnRisky failOnWarning --- phpunit.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpunit.xml b/phpunit.xml index 1f0b00f4476..8349a685602 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,6 +1,8 @@