adyen-php-api-library icon indicating copy to clipboard operation
adyen-php-api-library copied to clipboard

[PW-2782] Testing environment is incompatible with declared support php versions

Open rvitaliy opened this issue 5 years ago • 4 comments
trafficstars

Hi i noticed what phpunit/phpunit: 9.1 support php: ^7.3 but this project declare support for php >= 5.3, i suppose that this environment are not covered by tests and that the support must been dropped.

Then, if support for old php version is dropped we can start to upgrade code base to typed properties and return types or this lib must rollback phpunit to support oldest php versions. I suggest to drop old php versions, but it's code owner decision.

If you tell me how you prefer to move, I can help you solve the problem and prepare a PR.

rvitaliy avatar Apr 17 '20 08:04 rvitaliy

Hey @rvitaliy,

Sorry for the late response and thank you for this feedback, we'll take a look at this support discrepancy and keep you posted.

Ángel Campos

acampos1916 avatar May 01 '20 13:05 acampos1916

Hey,

As the one behind making this decision, let me open my thought process.

Indeed we offer support for PHP versions that are very outdated. The reason being that it's quite difficult for us to track which PHP Versions are being used by merchants.

It's also pretty hard to setup a PHP environment with said versions. Ondrej's PPA for PHP versions only offer versions 5.6+, and finding boxes that support PHP 5.3 is not so trivial.

And then there's PHPUnit support, which I believe support for PHP 5.3 was dropped in PHPUnit 5. This means that it's hard to find documentation for PHPUnit when we want to create or change tests that require a bit more than just assertEquals.

We discussed internally and decided to maintain PHP 5.3 as a sanity-only check. Travis CI offers a PHP 5.3 box, so we run the built-in PHP Lint (php -l) and make sure that the code compiles. Meanwhile, in PHP 7.4 we run Unit Tests in Travis and make try to make sure it works.

Thank you for raising this issue. We are studying ways to figure this out as well, while still maintaining a healthy relationship with our customers.

I'll close this issue soon since it's something we're actively trying to improve, even though the issue itself isn't solved yet. Feel free to leave comments or open more issues to discuss this kind of improvements.

Cheers! Marcos Adyen

msilvagarcia avatar May 04 '20 06:05 msilvagarcia

I think if you want to offer support for old versions, it is ok to do it, consider that these users if they don't update the PHP then they don't update your library either. I think the best solution would be to make a dedicated branch for legacy PHP and a new one for supported PHP, where you can have well-tested and more secure code. It would be nice for those who are using PHP not abandoned to have an updated code, especially for a library that deals with payments.

rvitaliy avatar May 04 '20 09:05 rvitaliy

That is a great idea, one that probably didn't pop in our heads. I am sharing this with the team and we will discuss if there's a way to do this while keeping our sanity.

Cheers! Marcos Adyen

msilvagarcia avatar May 06 '20 07:05 msilvagarcia