Skip to content

Commit

Permalink
Update Travis CI config (#53)
Browse files Browse the repository at this point in the history
* Update Travis CI config

- Remove unnecessary environment variable GITHUB_OAUTH_TOKEN (former API limit has been [removed](composer/composer#4884 (comment)) 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.
  • Loading branch information
fnogatz committed May 2, 2021
1 parent ce579c2 commit bc70f62
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 31 deletions.
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/CustomerData/Checkout/CartPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/CustomerData/Customer/CustomerPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/Helper/DataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/Helper/TrackerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class TrackerTest extends \PHPUnit\Framework\TestCase
*
* @return void
*/
public function setUp()
public function setUp(): void
{
$objectManager = new ObjectManager($this);

Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/Model/TrackerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/Observer/BeforeTrackPageViewObserverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/Observer/CartViewObserverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/Observer/CategoryViewObserverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/Observer/CheckoutSuccessObserverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class CheckoutSuccessObserverTest extends \PHPUnit\Framework\TestCase
*
* @return void
*/
public function setUp()
public function setUp(): void
{
$objectMgr = new ObjectManager($this);

Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/Observer/ProductViewObserverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Test/Unit/Observer/SearchResultObserverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 1 addition & 10 deletions dev/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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"
Expand Down

0 comments on commit bc70f62

Please sign in to comment.