From 8254ead0c4cd8132c41adcab228063708c251b7b Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Tue, 20 Feb 2018 10:55:47 +0100 Subject: [PATCH 1/4] Add support for Symfony 4 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c0746a5..d0f3d95 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ ], "require": { "php": ">=5.4.0", - "symfony/options-resolver": "~2.6 || ~3.0" + "symfony/options-resolver": "~2.6 || ~3.0 || ^4.0" }, "require-dev": { "phpspec/phpspec": "~2.0" From 9a90602ffff63182e2b44df205ee71b8a09aecf1 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sun, 9 Dec 2018 10:55:02 +0100 Subject: [PATCH 2/4] Fix compatibility with PHPUnit 6+ The min version of PHPUnit supported to run tests is now 4.8.35, which is the version adding the forward-compatibility layer. --- tests/CsvTest.php | 3 ++- tests/XlsxTest.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/CsvTest.php b/tests/CsvTest.php index bd589e2..5ff97f2 100644 --- a/tests/CsvTest.php +++ b/tests/CsvTest.php @@ -2,6 +2,7 @@ use Akeneo\Component\SpreadsheetParser\Csv\CsvParser; use Akeneo\Component\SpreadsheetParser\SpreadsheetParser; +use PHPUnit\Framework\TestCase; /** * Functional tests for CSV files @@ -10,7 +11,7 @@ * @copyright 2014 Akeneo SAS (http://www.akeneo.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class CsvTest extends PHPUnit_Framework_TestCase +class CsvTest extends TestCase { public function testReadFile() { diff --git a/tests/XlsxTest.php b/tests/XlsxTest.php index a31a394..07f4bd3 100644 --- a/tests/XlsxTest.php +++ b/tests/XlsxTest.php @@ -2,6 +2,7 @@ use Akeneo\Component\SpreadsheetParser\SpreadsheetParser; use Akeneo\Component\SpreadsheetParser\Xlsx\XlsxParser; +use PHPUnit\Framework\TestCase; /** * Functional tests for XLSX files @@ -10,7 +11,7 @@ * @copyright 2014 Akeneo SAS (http://www.akeneo.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class XlsxTest extends PHPUnit_Framework_TestCase +class XlsxTest extends TestCase { public function testLibreOfficeFile() { From 70969089029a286b2f525fd9f44e5fce3fcc45a4 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sun, 9 Dec 2018 10:55:02 +0100 Subject: [PATCH 3/4] Add testing on PHP 7.1, 7.2 and 7.3 on Travis Testing on HHVM is removed, as phpspec is not compatible with it. --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index b78db0b..260f03a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,15 +11,15 @@ php: - 5.5 - 5.6 - 7.0 - - hhvm + - 7.1 + - 7.2 + - 7.3 env: - COMPOSER_FLAGS='--prefer-dist' matrix: fast_finish: true - allow_failures: - - php: hhvm include: - php: 5.4 env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' SYMFONY_DEPRECATIONS_HELPER=weak @@ -27,9 +27,9 @@ matrix: env: COMPOSER_FLAGS='--prefer-dist' DEPENDENCIES=dev before_install: - - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then phpenv config-rm xdebug.ini; fi + - if [ "$TRAVIS_PHP_VERSION" != "7.3" ]; then phpenv config-rm xdebug.ini; fi - composer self-update - - if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi; + - if [ "$DEPENDENCIES" = "dev" ]; then composer config minimum-stability dev; fi; install: - composer update $COMPOSER_FLAGS From 7a1a414cb513809e51a0bb9f6057c53463620179 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sun, 9 Dec 2018 11:08:04 +0100 Subject: [PATCH 4/4] Use the Symfony PHPUnit bridge to run PHPUnit on CI The Travis PHP 5.5 image ships a version of PHPUnit with the forward compatibility layer for namespaced classes. --- .travis.yml | 3 ++- composer.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 260f03a..dadeb8d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,8 @@ before_install: install: - composer update $COMPOSER_FLAGS + - bin/simple-phpunit install script: - bin/phpspec run -f dot - - phpunit -v + - bin/simple-phpunit -v diff --git a/composer.json b/composer.json index d0f3d95..5310aeb 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,8 @@ "symfony/options-resolver": "~2.6 || ~3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "phpspec/phpspec": "~2.0", + "symfony/phpunit-bridge": "^4.2" }, "autoload": { "psr-4": {