Skip to content

Commit

Permalink
Test on GH Actions (#260)
Browse files Browse the repository at this point in the history
* Test on GH Actions

* Update composer.json

* Update composer.json

* Fix tests

* Update run-tests.yml

* Update run-tests.yml

* Update run-tests.yml

* Update composer.json
  • Loading branch information
barryvdh authored Oct 31, 2022
1 parent dbd8508 commit 93e55fc
Show file tree
Hide file tree
Showing 36 changed files with 89 additions and 37 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Unit Tests

on:
push:
branches:
- master
pull_request:
branches:
- "*"
schedule:
- cron: '0 0 * * *'

jobs:
php-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1

strategy:
matrix:
php: [8.1, 8.0, 7.4, 7.3, 7.2]
dependency-version: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: composer:v2

- name: Install dependencies
run: |
composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress
- name: Execute Unit Tests
run: composer test

- name: Check Code Style
run: composer check-style
if: ${{ matrix.dependency-version == 'prefer-stable' }}
11 changes: 8 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,22 @@
"psr-4": { "Omnipay\\PayPal\\" : "src/" }
},
"require": {
"php": "^7.2|^8.0",
"omnipay/common": "^3"
},
"require-dev": {
"omnipay/tests": "^3",
"squizlabs/php_codesniffer": "^3",
"phpro/grumphp": "^0.14"
"omnipay/tests": "^4.1.2",
"squizlabs/php_codesniffer": "^3"
},
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
}
},
"scripts": {
"test": "phpunit",
"check-style": "phpcs -p --standard=PSR2 src/",
"fix-style": "phpcbf -p --standard=PSR2 src/"
},
"prefer-stable": true
}
2 changes: 1 addition & 1 deletion tests/ExpressGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ExpressGatewayTest extends GatewayTestCase
*/
protected $voidOptions;

public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/ExpressInContextGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ExpressInContextGatewayTest extends GatewayTestCase
*/
protected $voidOptions;

public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/CaptureRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CaptureRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/ExpressAuthorizeRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ExpressAuthorizeRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/ExpressCompleteAuthorizeRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ExpressCompleteAuthorizeRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/ExpressCompletePurchaseRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ExpressCompletePurchaseRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/ExpressFetchCheckoutRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ExpressFetchCheckoutRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/ExpressInContextAuthorizeRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ExpressInContextAuthorizeRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/ExpressTransactionSearchRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ExpressTransactionSearchRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/ExpressVoidRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ExpressVoidRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/FetchTransactionRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class FetchTransactionRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/ProAuthorizeRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ProAuthorizeRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/ProPurchaseRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ProPurchaseRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RefundRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class RefundRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestAuthorizeRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class RestAuthorizeRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestCancelSubscriptionRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RestCancelSubscriptionRequestTest extends TestCase
/** @var \Omnipay\PayPal\Message\RestCancelSubscriptionRequest */
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestCompletePurchaseRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class RestCompletePurchaseRequestTest extends TestCase
private $request;


public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestCompleteSubscriptionRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RestCompleteSubscriptionRequestTest extends TestCase
/** @var \Omnipay\PayPal\Message\RestCompleteSubscriptionRequest */
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestCreateCardRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class RestCreateCardRequestTest extends TestCase
/** @var CreditCard */
protected $card;

public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestCreatePlanRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RestCreatePlanRequestTest extends TestCase
/** @var \Omnipay\PayPal\Message\RestCreatePlanRequest */
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestCreateSubscriptionRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RestCreateSubscriptionRequestTest extends TestCase
/** @var \Omnipay\PayPal\Message\RestCreateSubscriptionRequest */
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestCreateWebhookRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class RestCreateWebhookRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestDeleteCardRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class RestDeleteCardRequestTest extends TestCase
/** @var CreditCard */
private $card;

public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestFetchPurchaseRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class RestFetchPurchaseRequestTest extends TestCase
/** @var \Omnipay\PayPal\Message\RestFetchPurchaseRequest */
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestFetchTransactionRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class RestFetchTransactionRequestTest extends TestCase
/** @var \Omnipay\PayPal\Message\RestFetchTransactionRequest */
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestListPlanRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class RestListPlanRequestTest extends TestCase
/** @var \Omnipay\PayPal\Message\RestListPlanRequest */
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestListWebhooksRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class RestListWebhooksRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestReactivateSubscriptionRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RestReactivateSubscriptionRequestTest extends TestCase
/** @var \Omnipay\PayPal\Message\RestReactivateSubscriptionRequest */
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestSearchTransactionRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RestSearchTransactionRequestTest extends TestCase
/** @var \Omnipay\PayPal\Message\RestSearchTransactionRequest */
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestSuspendSubscriptionRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RestSuspendSubscriptionRequestTest extends TestCase
/** @var \Omnipay\PayPal\Message\RestSuspendSubscriptionRequest */
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestUpdatePlanRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RestUpdatePlanRequestTest extends TestCase
/** @var \Omnipay\PayPal\Message\RestUpdatePlanRequest */
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/Message/RestVerifyWebhookSignatureRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class RestVerifyWebhookSignatureRequestTest extends TestCase
*/
private $request;

public function setUp()
public function setUp() : void
{
$client = $this->getHttpClient();
$request = $this->getHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/ProGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class ProGatewayTest extends GatewayTestCase
{
public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/RestGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RestGatewayTest extends GatewayTestCase
/** @var array */
public $subscription_options;

public function setUp()
public function setUp() : void
{
parent::setUp();

Expand Down

0 comments on commit 93e55fc

Please sign in to comment.