Merge pull request #226 from woocommerce/ci-all-php-7x

Run CI for PHP 7.1-7.4
This commit is contained in:
Emili Castells 2021-08-19 09:38:59 +02:00 committed by GitHub
commit 406321375a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 7 deletions

View file

@ -13,7 +13,7 @@ jobs:
strategy: strategy:
matrix: matrix:
php-versions: ['7.3'] php-versions: ['7.1', '7.2', '7.3', '7.4']
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -27,7 +27,9 @@ jobs:
run: composer validate run: composer validate
- name: Install dependencies - name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest uses: ramsey/composer-install@v1
with:
composer-options: "--prefer-dist"
- name: Run test suite - name: Run test suite
run: ./vendor/bin/phpunit run: ./vendor/bin/phpunit

View file

@ -16,8 +16,6 @@ PayPal's latest complete payments processing solution. Accept PayPal, Pay Later,
4. `$ yarn run build:dev` 4. `$ yarn run build:dev`
5. Change the `PAYPAL_INTEGRATION_DATE` constant to `gmdate( 'Y-m-d' )` to run the latest PayPal JavaScript SDK 5. Change the `PAYPAL_INTEGRATION_DATE` constant to `gmdate( 'Y-m-d' )` to run the latest PayPal JavaScript SDK
Note: PHPUnit needs at least PHP 7.3.
### Unit tests and code style ### Unit tests and code style
1. `$ composer install` 1. `$ composer install`

View file

@ -15,7 +15,7 @@
}, },
"require-dev": { "require-dev": {
"woocommerce/woocommerce-sniffs": "^0.1.0", "woocommerce/woocommerce-sniffs": "^0.1.0",
"phpunit/phpunit": "^9.1", "phpunit/phpunit": "^7.0 | ^8.0 | ^9.0",
"brain/monkey": "^2.4" "brain/monkey": "^2.4"
}, },
"autoload": { "autoload": {

View file

@ -14,6 +14,7 @@ use Mockery;
class OrderTest extends TestCase class OrderTest extends TestCase
{ {
private $dateFormat = 'Y-m-d\TH:i:sO'; // no DateTimeInterface::ISO8601 in 7.1
public function testOrder() public function testOrder()
{ {
@ -64,8 +65,8 @@ class OrderTest extends TestCase
'purchase_units' => [ 'purchase_units' => [
[1], [1],
], ],
'create_time' => $createTime->format(\DateTimeInterface::ISO8601), 'create_time' => $createTime->format($this->dateFormat),
'update_time' => $updateTime->format(\DateTimeInterface::ISO8601), 'update_time' => $updateTime->format($this->dateFormat),
'payer' => ['payer'], 'payer' => ['payer'],
'application_context' => ['applicationContext'], 'application_context' => ['applicationContext'],
'payment_source' => ['paymentSource'] 'payment_source' => ['paymentSource']