From 9d7f3b83c2bade6e99adf4cbbaaa62f9c923226b Mon Sep 17 00:00:00 2001 From: Paragon Initiative Enterprises Date: Thu, 15 Oct 2020 04:35:20 -0400 Subject: [PATCH 1/5] Fix tests and dependencies --- .travis.yml | 16 ++++++++-------- other/phpunit-shim.php | 6 ++++++ phpunit-autoload.php | 14 ++++++++++++++ phpunit.xml.dist | 40 +++++++++++----------------------------- psalm-autoload.php | 10 +++++----- psalm.xml | 32 ++++++++++++++++++++------------ 6 files changed, 64 insertions(+), 54 deletions(-) create mode 100644 other/phpunit-shim.php create mode 100644 phpunit-autoload.php diff --git a/.travis.yml b/.travis.yml index 65bd6ba..d50027d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,16 +18,16 @@ matrix: CHECK_MBSTRING=1 - dist: precise php: "5.6" - env: USE_PSALM=1 + env: USE_PSALM=0 CHECK_MBSTRING=1 - php: "7.0" - env: USE_PSALM=1 + env: USE_PSALM=0 CHECK_MBSTRING=1 - php: "7.1" - env: USE_PSALM=1 - CHECK_MBSTRING=1 + env: USE_PSALM=0 + CHECK_MBSTRING=0 - php: "7.2" - env: USE_PSALM=1 + env: USE_PSALM=0 CHECK_MBSTRING=0 - php: "7.3" env: USE_PSALM=1 @@ -49,9 +49,9 @@ matrix: - php: "master" install: - - composer self-update - - composer install - - if [[ $USE_PSALM -eq 1 ]]; then composer require --dev "vimeo/psalm:^0|^1|^2"; fi + - travis_retry composer install + - if [[ $USE_PSALM -eq 1 ]]; then composer require --dev "phpunit/phpunit:>=4"; fi + - if [[ $USE_PSALM -eq 1 ]]; then composer require --dev "vimeo/psalm:^3"; fi script: - vendor/bin/phpunit diff --git a/other/phpunit-shim.php b/other/phpunit-shim.php new file mode 100644 index 0000000..3c5d0e2 --- /dev/null +++ b/other/phpunit-shim.php @@ -0,0 +1,6 @@ += 5.3 + * + * Class PHPUnit_Framework_TestCase + */ +if (PHP_VERSION_ID >= 50300) { + if (!class_exists('PHPUnit_Framework_TestCase')) { + require_once __DIR__ . '/other/phpunit-shim.php'; + } +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 19c5e22..4887008 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,31 +1,13 @@ - - - - tests/unit - - - - - ./tests/unit - - - - - ./lib - - + + + + ./lib + + + + + ./tests/unit + + diff --git a/psalm-autoload.php b/psalm-autoload.php index d71d1b8..fb0c89a 100644 --- a/psalm-autoload.php +++ b/psalm-autoload.php @@ -1,9 +1,9 @@ + + - + + + + + - + - + + + - + - + - + - + From 282e774cf28504e4df250fa8d791fe15ac425c03 Mon Sep 17 00:00:00 2001 From: Paragon Initiative Enterprises Date: Thu, 15 Oct 2020 05:50:50 -0400 Subject: [PATCH 2/5] Attempt to invalidate locked dependencies --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index d50027d..9f3bb96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,6 +51,8 @@ matrix: install: - travis_retry composer install - if [[ $USE_PSALM -eq 1 ]]; then composer require --dev "phpunit/phpunit:>=4"; fi + - if [[ $USE_PSALM -eq 1 ]]; then rm composer.lock; fi + - if [[ $USE_PSALM -eq 1 ]]; then rm -rf vendor; fi - if [[ $USE_PSALM -eq 1 ]]; then composer require --dev "vimeo/psalm:^3"; fi script: From 2a7ecc1bd3c1f1142f7de605cfb9d801bdc4f9e8 Mon Sep 17 00:00:00 2001 From: Paragon Initiative Enterprises Date: Thu, 15 Oct 2020 05:56:34 -0400 Subject: [PATCH 3/5] Don't check mbstring --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9f3bb96..3b63f82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,5 +57,5 @@ install: script: - vendor/bin/phpunit - - php -dmbstring.func_overload=7 vendor/bin/phpunit + - if [[ $CHECK_MBSTRING -eq 1 ]]; then php -dmbstring.func_overload=7 vendor/bin/phpunit; fi - if [[ $USE_PSALM -eq 1 ]]; then vendor/bin/psalm; fi From 4612027a4dc3281b3ed46baf095059f5550ae899 Mon Sep 17 00:00:00 2001 From: Paragon Initiative Enterprises Date: Thu, 15 Oct 2020 05:57:12 -0400 Subject: [PATCH 4/5] Don't use Psalm in PHP 8 until they release a new version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3b63f82..fa50cce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ matrix: env: USE_PSALM=1 CHECK_MBSTRING=0 - php: "nightly" - env: USE_PSALM=1 + env: USE_PSALM=0 CHECK_MBSTRING=0 - php: "hhvm" env: USE_PSALM=1 From 1d04681b989c4ec7dc1153be756368c2c810398c Mon Sep 17 00:00:00 2001 From: Paragon Initiative Enterprises Date: Thu, 15 Oct 2020 06:06:43 -0400 Subject: [PATCH 5/5] Nightly can fail --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index fa50cce..ff444b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,6 +45,7 @@ matrix: env: USE_PSALM=1 CHECK_MBSTRING=0 allow_failures: + - php: "nightly" - php: "hhvm" - php: "master"