academe / SagePay-Integration

HTTP Messages for the Sage Pay REST (Pi) gateway.
GNU General Public License v3.0
9 stars 5 forks source link

No travis tests running under PHP 7 #59

Closed judgej closed 7 years ago

judgej commented 7 years ago

Not sure what's happening there, but travis is not running any tests under PHP7. The test suite is coming up successful for that version though, so it's not obvious without digging deeper that something is not right.

judgej commented 7 years ago

The log for 7.1 gives us this:

$ php --version

PHP 7.1.9 (cli) (built: Sep  9 2017 16:08:02) ( ZTS )

Copyright (c) 1997-2017 The PHP Group

Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

    with Zend OPcache v7.1.9, Copyright (c) 1999-2017, by Zend Technologies

    with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans

$ composer --version

Composer version 1.5.2 2017-09-11 16:59:25

before_script.1

0.50s$ composer self-update

You are already using composer version 1.5.2 (stable channel).

before_script.2

5.27s$ composer install --no-interaction --dev

You are using the deprecated option "dev". Dev packages are installed by default now.

Loading composer repositories with package information

Updating dependencies (including require-dev)

Package operations: 16 installs, 0 updates, 0 removals

  - Installing alcohol/iso4217 (3.1.0): Downloading (100%)

  - Installing squizlabs/php_codesniffer (2.9.1): Downloading (100%)

  - Installing shrikeh/teapot (v1.0.2): Downloading (100%)

  - Installing psr/http-message (1.0.1): Downloading (100%)

  - Installing symfony/yaml (v2.8.27): Downloading (100%)

  - Installing sebastian/version (1.0.6): Downloading (100%)

  - Installing sebastian/exporter (1.0.2): Downloading (100%)

  - Installing sebastian/environment (1.3.8): Downloading (100%)

  - Installing sebastian/diff (1.4.3): Downloading (100%)

  - Installing phpunit/php-text-template (1.2.1): Downloading (100%)

  - Installing phpunit/phpunit-mock-objects (2.0.10): Downloading (100%)

  - Installing phpunit/php-timer (1.0.9): Downloading (100%)

  - Installing phpunit/php-file-iterator (1.3.4): Downloading (100%)

  - Installing phpunit/php-token-stream (1.4.11): Downloading (100%)

  - Installing phpunit/php-code-coverage (2.0.17): Downloading (100%)

  - Installing phpunit/phpunit (4.0.20): Downloading (100%)

phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)

Writing lock file

Generating autoload files

0.16s$ phpunit

PHPUnit 6.3.0 by Sebastian Bergmann and contributors.

Time: 84 ms, Memory: 12.00MB

No tests executed!

The command "phpunit" exited with 0.

Done. Your build exited with 0.

Note no tests are run. Running locally by hand with PHP7.1:

-bash-4.1$ phpunit  --bootstrap  vendor/autoload.php SagePay-Integration/
PHPUnit 5.7.14 by Sebastian Bergmann and contributors.

.............                                                     13 / 13 (100%)

Time: 117 ms, Memory: 10.00MB

OK (13 tests, 14 assertions)
judgej commented 7 years ago

The difference I can see is that PHPunit 6.3.0 is run for PHP7.0+, but PHPunit 5.6 is run for lower PHP versions, and PHP5.7 for my manual tests.

judgej commented 7 years ago

Yay, all working now.

The CS tests were not being run, so they have been added, and a bunch of non-functional formatting fixed as a result. There will be no release needed for those fixes,

By pulling in omnipay/tests ~2.0, that sets the dependency for the PHP Unit command version (~2.0, I believe) so PHP Unit 6.x does not get pulled in. That later version uses different classes and would need the tests to be re-written before it can be used.

Now, having written that, I just realised this is not an Omnipay driver (yet) and so I need to find about way around locking in the PHP Unit version.

judgej commented 7 years ago

Stuck to PHP Unit 4.8 to cover all PHP versions from 5.5

I'm sure there is a better way to do this, and that probably involves dropping support for PHP 5.5, but this will do for now.