From bc70f625f3935ed7e4f24fe3b0be8ae84f7b5da7 Mon Sep 17 00:00:00 2001 From: Falco Nogatz Date: Sun, 2 May 2021 10:35:44 +0200 Subject: [PATCH] Update Travis CI config (#53) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update Travis CI config - Remove unnecessary environment variable GITHUB_OAUTH_TOKEN (former API limit has been [removed](https://github.com/composer/composer/issues/4884#issuecomment-195229989) in 2016) - Remove manual doctrine/instantiator downgrade - We support only PHP 7.3 and 7.4 as well as M2 starting from v2.3.3 (former versions reached EOL) * Fix PHP Fatal Error with PHPUnit setUp() must be compatible with PHPUnit\Framework\TestCase::setUp() – add missing declaration of "void" as return value * Trigger Travis CI * CI: Remove testing for M2 v2.3.3 and v2.3.4 Magento version prior to v2.3.5 depend on xdebug<3, so these tests fail with a "Call to undefined function xdebug_disable()" error. We simply stick to the latest two versions of Magento v2.3.x. --- .travis.yml | 20 +++++++++---------- .../CustomerData/Checkout/CartPluginTest.php | 2 +- .../Customer/CustomerPluginTest.php | 2 +- Test/Unit/Helper/DataTest.php | 2 +- Test/Unit/Helper/TrackerTest.php | 2 +- Test/Unit/Model/TrackerTest.php | 2 +- .../BeforeTrackPageViewObserverTest.php | 2 +- Test/Unit/Observer/CartViewObserverTest.php | 2 +- .../Observer/CategoryViewObserverTest.php | 2 +- .../Observer/CheckoutSuccessObserverTest.php | 2 +- .../Unit/Observer/ProductViewObserverTest.php | 2 +- .../Observer/SearchResultObserverTest.php | 2 +- dev/ci/build.sh | 11 +--------- 13 files changed, 22 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88cf1c0..bb99491 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,17 @@ language: php php: - - 7.2 - - 7.1 + - 7.4 + - 7.3 env: - - M2_VERSION=2.3.2 - - M2_VERSION=2.3.1 - - M2_VERSION=2.3.0 -matrix: + - M2_VERSION=2.4.2 + - M2_VERSION=2.4.1 + - M2_VERSION=2.4.0 +jobs: include: - - php: 7.1 - env: M2_VERSION=2.2.9 - - php: 7.0 - env: M2_VERSION=2.2.9 + - php: 7.3 + env: M2_VERSION=2.3.6-p1 + - php: 7.3 + env: M2_VERSION=2.3.5 cache: directories: - $HOME/.composer/cache diff --git a/Test/Unit/CustomerData/Checkout/CartPluginTest.php b/Test/Unit/CustomerData/Checkout/CartPluginTest.php index f5312e3..aa1d75e 100644 --- a/Test/Unit/CustomerData/Checkout/CartPluginTest.php +++ b/Test/Unit/CustomerData/Checkout/CartPluginTest.php @@ -77,7 +77,7 @@ class CartPluginTest extends \PHPUnit\Framework\TestCase * * @return void */ - public function setUp() + public function setUp(): void { $className = \Chessio\Matomo\CustomerData\Checkout\CartPlugin::class; $objectManager = new ObjectManager($this); diff --git a/Test/Unit/CustomerData/Customer/CustomerPluginTest.php b/Test/Unit/CustomerData/Customer/CustomerPluginTest.php index bb990c0..6890967 100644 --- a/Test/Unit/CustomerData/Customer/CustomerPluginTest.php +++ b/Test/Unit/CustomerData/Customer/CustomerPluginTest.php @@ -77,7 +77,7 @@ class CustomerPluginTest extends \PHPUnit\Framework\TestCase * * @return void */ - public function setUp() + public function setUp(): void { $className = \Chessio\Matomo\CustomerData\Customer\CustomerPlugin::class; $objectManager = new ObjectManager($this); diff --git a/Test/Unit/Helper/DataTest.php b/Test/Unit/Helper/DataTest.php index c1c3f84..f2e7469 100644 --- a/Test/Unit/Helper/DataTest.php +++ b/Test/Unit/Helper/DataTest.php @@ -57,7 +57,7 @@ class DataTest extends \PHPUnit\Framework\TestCase * * @return void */ - public function setUp() + public function setUp(): void { $className = \Chessio\Matomo\Helper\Data::class; $objectManager = new ObjectManager($this); diff --git a/Test/Unit/Helper/TrackerTest.php b/Test/Unit/Helper/TrackerTest.php index 6b38c59..7c24f4e 100644 --- a/Test/Unit/Helper/TrackerTest.php +++ b/Test/Unit/Helper/TrackerTest.php @@ -49,7 +49,7 @@ class TrackerTest extends \PHPUnit\Framework\TestCase * * @return void */ - public function setUp() + public function setUp(): void { $objectManager = new ObjectManager($this); diff --git a/Test/Unit/Model/TrackerTest.php b/Test/Unit/Model/TrackerTest.php index 7b8881d..3b482e1 100644 --- a/Test/Unit/Model/TrackerTest.php +++ b/Test/Unit/Model/TrackerTest.php @@ -50,7 +50,7 @@ class TrackerTest extends \PHPUnit\Framework\TestCase * * @return void */ - public function setUp() + public function setUp(): void { $className = \Chessio\Matomo\Model\Tracker::class; $objectManager = new ObjectManager($this); diff --git a/Test/Unit/Observer/BeforeTrackPageViewObserverTest.php b/Test/Unit/Observer/BeforeTrackPageViewObserverTest.php index 1b0c583..5e45ff3 100644 --- a/Test/Unit/Observer/BeforeTrackPageViewObserverTest.php +++ b/Test/Unit/Observer/BeforeTrackPageViewObserverTest.php @@ -70,7 +70,7 @@ class BeforeTrackPageViewObserverTest extends \PHPUnit\Framework\TestCase * * @return void */ - public function setUp() + public function setUp(): void { $className = \Chessio\Matomo\Observer\BeforeTrackPageViewObserver::class; $objectManager = new ObjectManager($this); diff --git a/Test/Unit/Observer/CartViewObserverTest.php b/Test/Unit/Observer/CartViewObserverTest.php index 3427b15..a4440de 100644 --- a/Test/Unit/Observer/CartViewObserverTest.php +++ b/Test/Unit/Observer/CartViewObserverTest.php @@ -84,7 +84,7 @@ class CartViewObserverTest extends \PHPUnit\Framework\TestCase * * @return void */ - public function setUp() + public function setUp(): void { $className = \Chessio\Matomo\Observer\CartViewObserver::class; $objectManager = new ObjectManager($this); diff --git a/Test/Unit/Observer/CategoryViewObserverTest.php b/Test/Unit/Observer/CategoryViewObserverTest.php index 3b81ecf..01f7822 100644 --- a/Test/Unit/Observer/CategoryViewObserverTest.php +++ b/Test/Unit/Observer/CategoryViewObserverTest.php @@ -77,7 +77,7 @@ class CategoryViewObserverTest extends \PHPUnit\Framework\TestCase * * @return void */ - public function setUp() + public function setUp(): void { $className = \Chessio\Matomo\Observer\CategoryViewObserver::class; $objectManager = new ObjectManager($this); diff --git a/Test/Unit/Observer/CheckoutSuccessObserverTest.php b/Test/Unit/Observer/CheckoutSuccessObserverTest.php index 2ebe547..58325dc 100644 --- a/Test/Unit/Observer/CheckoutSuccessObserverTest.php +++ b/Test/Unit/Observer/CheckoutSuccessObserverTest.php @@ -91,7 +91,7 @@ class CheckoutSuccessObserverTest extends \PHPUnit\Framework\TestCase * * @return void */ - public function setUp() + public function setUp(): void { $objectMgr = new ObjectManager($this); diff --git a/Test/Unit/Observer/ProductViewObserverTest.php b/Test/Unit/Observer/ProductViewObserverTest.php index 046094f..f0371e1 100644 --- a/Test/Unit/Observer/ProductViewObserverTest.php +++ b/Test/Unit/Observer/ProductViewObserverTest.php @@ -84,7 +84,7 @@ class ProductViewObserverTest extends \PHPUnit\Framework\TestCase * * @return void */ - public function setUp() + public function setUp(): void { $className = \Chessio\Matomo\Observer\ProductViewObserver::class; $objectManager = new ObjectManager($this); diff --git a/Test/Unit/Observer/SearchResultObserverTest.php b/Test/Unit/Observer/SearchResultObserverTest.php index 77221b8..a0489a3 100644 --- a/Test/Unit/Observer/SearchResultObserverTest.php +++ b/Test/Unit/Observer/SearchResultObserverTest.php @@ -91,7 +91,7 @@ class SearchResultObserverTest extends \PHPUnit\Framework\TestCase * * @return void */ - public function setUp() + public function setUp(): void { $className = \Chessio\Matomo\Observer\SearchResultObserver::class; $objectManager = new ObjectManager($this); diff --git a/dev/ci/build.sh b/dev/ci/build.sh index 54dcf31..fe08a25 100755 --- a/dev/ci/build.sh +++ b/dev/ci/build.sh @@ -20,8 +20,7 @@ for envkey in \ MODULE_SRC_DIR \ M2_VERSION \ M2_REPO_USERNAME \ - M2_REPO_PASSWORD \ - GITHUB_OAUTH_TOKEN + M2_REPO_PASSWORD do if [ -z "$(eval echo \$$envkey)" ] then @@ -44,8 +43,6 @@ fi # Set composer authentication params "$COMPOSER_BIN" config --global \ "http-basic.repo.magento.com" "$M2_REPO_USERNAME" "$M2_REPO_PASSWORD" -"$COMPOSER_BIN" config --global \ - "github-oauth.github.com" "$GITHUB_OAUTH_TOKEN" set -x @@ -57,12 +54,6 @@ set -x magento/project-community-edition \ "$BUILD_DIR" "$M2_VERSION" -# Downgrade doctrine/instantiator for PHP < 7.1 support -"$COMPOSER_BIN" require \ - --working-dir="$BUILD_DIR" \ - --ignore-platform-reqs \ - doctrine/instantiator:v1.0.5 - # Copy module into Magento mkdir -p "$(dirname "$MODULE_DST_DIR")" cp -r "$MODULE_SRC_DIR" "$MODULE_DST_DIR"