From 41d02003c21e7a5de6452bc957408eda19def074 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 27 Jan 2020 12:04:42 +0000 Subject: [PATCH] Install PHPStan and PHPUnit via dev dependencies --- .travis.yml | 5 ++- composer.json | 6 +++- composer.lock | 92 +++++++++++++++++++++++++++++++++++++++++++++++-- tests/travis.sh | 7 ---- 4 files changed, 99 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index dcc2e1298..284bc28b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,9 +16,12 @@ before_script: - make install - cd .. - echo "extension=pthreads.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - composer install script: + - composer install + - ./vendor/bin/phpstan analyze --no-progress --memory-limit=2G + - ./vendor/bin/phpunit --bootstrap vendor/autoload.php --fail-on-warning tests/phpunit + - composer install --no-dev - ./tests/travis.sh -t4 notifications: diff --git a/composer.json b/composer.json index 35a7e8efc..de55e48a4 100644 --- a/composer.json +++ b/composer.json @@ -73,5 +73,9 @@ "type": "vcs", "url": "https://github.com/pmmp/Snooze" } - ] + ], + "require-dev": { + "phpstan/phpstan": "^0.12.8", + "irstea/phpunit-shim": "^7.5" + } } diff --git a/composer.lock b/composer.lock index e58e461b9..750eb556b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f693f278b3bb9c1d266079fa17644dcb", + "content-hash": "38e3ec606dda17c95dd5456b24af547b", "packages": [ { "name": "adhocore/json-comment", @@ -305,7 +305,95 @@ "time": "2020-01-14T16:23:26+00:00" } ], - "packages-dev": [], + "packages-dev": [ + { + "name": "irstea/phpunit-shim", + "version": "7.5.20", + "source": { + "type": "git", + "url": "https://gitlab.irstea.fr/pole-is/tools/phpunit-shim.git", + "reference": "81cd2d11e12165fddd2731033187dce4fbe8e013" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "php": "^7.1" + }, + "replace": { + "phpunit/phpunit": "self.version" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Shim repository for phpunit/phpunit", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "shim", + "testing", + "xunit" + ], + "time": "2020-01-09T03:20:19+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "0.12.8", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "62a552602b7586d82826231f2fd4cbfe39fe0b1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/62a552602b7586d82826231f2fd4cbfe39fe0b1d", + "reference": "62a552602b7586d82826231f2fd4cbfe39fe0b1d", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.12-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "time": "2020-01-26T23:36:48+00:00" + } + ], "aliases": [], "minimum-stability": "stable", "stability-flags": { diff --git a/tests/travis.sh b/tests/travis.sh index 12e15063b..a4d0e744b 100755 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -14,13 +14,6 @@ while getopts "p:t:" OPTION 2> /dev/null; do esac done -[ ! -f phpstan.phar ] && echo "Downloading PHPStan..." && curl -sSLO https://github.com/phpstan/phpstan/releases/download/0.12.8/phpstan.phar -"$PHP_BINARY" phpstan.phar analyze --no-progress --memory-limit=2G || exit 1 -echo "PHPStan scan succeeded" - -[ ! -f phpunit.phar ] && echo "Downloading PHPUnit..." && curl https://phar.phpunit.de/phpunit-7.phar --silent --location -o phpunit.phar -"$PHP_BINARY" phpunit.phar --bootstrap vendor/autoload.php --fail-on-warning tests/phpunit || exit 1 - #Run-the-server tests DATA_DIR="test_data" PLUGINS_DIR="$DATA_DIR/plugins"