Skip to content

Commit cbcd322

Browse files
committed
PHP 8 support with modern CI
1 parent 0c7fd76 commit cbcd322

File tree

12 files changed

+149
-55
lines changed

12 files changed

+149
-55
lines changed

.github/workflows/phpunit.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: "PHPUnit tests"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "master"
8+
9+
jobs:
10+
phpunit:
11+
name: "PHPUnit tests"
12+
13+
runs-on: "ubuntu-latest"
14+
15+
strategy:
16+
matrix:
17+
dependencies:
18+
- "highest"
19+
php-version:
20+
- "7.2"
21+
- "7.3"
22+
- "7.4"
23+
- "8.0"
24+
- "8.1"
25+
- "8.2"
26+
- "8.3"
27+
- "8.4"
28+
29+
include:
30+
- php-version: '7.2'
31+
dependencies: "lowest"
32+
33+
steps:
34+
- name: "Checkout"
35+
uses: "actions/checkout@v4"
36+
37+
- name: "Install PHP"
38+
uses: "shivammathur/setup-php@v2"
39+
with:
40+
coverage: "pcov"
41+
php-version: "${{ matrix.php-version }}"
42+
ini-values: memory_limit=-1
43+
tools: composer:v2
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
47+
# Fixes any pubkeys failure (add a `composer diagnose` step to debug if necessary)
48+
- name: "Composer force self-update"
49+
run: "composer self-update"
50+
51+
- name: "Install lowest dependencies"
52+
if: ${{ matrix.dependencies == 'lowest' }}
53+
run: "composer update --prefer-lowest --no-interaction --no-progress"
54+
55+
- name: "Install highest dependencies"
56+
if: ${{ matrix.dependencies == 'highest' }}
57+
run: "composer update --no-interaction --no-progress"
58+
59+
- name: "Tests (PHPUnit 9)"
60+
if: ${{ matrix.php-version <= '8.0' }}
61+
run: "vendor/bin/phpunit --configuration phpunit9.xml.dist"
62+
63+
- name: "Tests (PHPUnit 10+)"
64+
if: ${{ matrix.php-version >= '8.1' }}
65+
run: "vendor/bin/phpunit"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
composer.lock
33
composer.phar
44
phpunit.xml
5+
/.phpunit.result.cache
6+
/build

.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
* Ensure your code is nicely formatted in the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
88
style and that all tests pass.
99
* Send the pull request.
10-
* Check that the Travis CI build passed. If not, rinse and repeat.
10+
* Check that the CI build passed. If not, rinse and repeat.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**BPOINT driver for the Omnipay PHP payment processing library**
44

5-
[![Build Status](https://travis-ci.org/PatronBase/omnipay-bpoint.png?branch=master)](https://travis-ci.org/PatronBase/omnipay-bpoint)
5+
[![Build Status](https://github.com/PatronBase/omnipay-bpoint/actions/workflows/phpunit.yml/badge.svg?branch=master)](https://github.com/PatronBase/omnipay-bpoint/actions)
66
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/PatronBase/omnipay-bpoint.svg?style=flat)](https://scrutinizer-ci.com/g/PatronBase/omnipay-bpoint/code-structure)
77
[![Code Quality](https://img.shields.io/scrutinizer/g/PatronBase/omnipay-bpoint.svg?style=flat)](https://scrutinizer-ci.com/g/PatronBase/omnipay-bpoint/?branch=master)
88
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE.md)
@@ -11,8 +11,8 @@
1111

1212

1313
[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment
14-
processing library for PHP 5.6+. This package implements BPOINT support for Omnipay. It includes
15-
support for both redirect (3-party) and webservice (2-party) versions of the gateway.
14+
processing library for PHP 7.2+. This package implements BPOINT support for Omnipay. It includes
15+
support for only the redirect (3-party) version of the gateway.
1616

1717
## Installation
1818

composer.json

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,29 @@
3030
"psr-4": { "Omnipay\\BPOINT\\" : "tests/" }
3131
},
3232
"require": {
33-
"omnipay/common": "~3.0"
33+
"php": "^7.2|^8.0",
34+
"omnipay/common": "^3.1"
3435
},
3536
"require-dev": {
36-
"omnipay/tests": "~3.0",
37+
"omnipay/tests": "^4.1",
3738
"squizlabs/php_codesniffer": "^3.5",
38-
"symfony/psr-http-message-bridge": "~1.1.0"
39+
"symfony/psr-http-message-bridge": "~1.1.0|^2.0",
40+
"http-interop/http-factory-guzzle": "^1.1"
41+
},
42+
"scripts": {
43+
"test": "phpunit",
44+
"check-style": "phpcs -p --standard=PSR2 src/",
45+
"fix-style": "phpcbf -p --standard=PSR2 src/"
3946
},
4047
"extra": {
4148
"branch-alias": {
42-
"dev-master": "3.1.x-dev"
49+
"dev-master": "3.2.x-dev"
4350
}
4451
},
45-
"prefer-stable": true
52+
"prefer-stable": true,
53+
"config": {
54+
"allow-plugins": {
55+
"php-http/discovery": true
56+
}
57+
}
4658
}

phpunit.xml.dist

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
5+
backupGlobals="false"
6+
backupStaticProperties="false"
57
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
98
processIsolation="false"
10-
stopOnFailure="false"
11-
syntaxCheck="false">
12-
<php>
13-
<ini name="date.timezone" value="UTC" />
14-
</php>
15-
<testsuites>
16-
<testsuite name="Omnipay Test Suite">
17-
<directory>./tests/</directory>
18-
</testsuite>
19-
</testsuites>
20-
<filter>
21-
<whitelist>
22-
<directory>./src</directory>
23-
</whitelist>
24-
</filter>
9+
stopOnFailure="false">
10+
<coverage>
11+
<report>
12+
<clover outputFile="build/logs/clover.xml"/>
13+
<html outputDirectory="build/coverage"/>
14+
<text outputFile="build/coverage.txt"/>
15+
</report>
16+
</coverage>
17+
<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
18+
<include>
19+
<directory suffix=".php">src/</directory>
20+
</include>
21+
</source>
22+
<testsuites>
23+
<testsuite name="Omnipay Test Suite">
24+
<directory>tests</directory>
25+
</testsuite>
26+
</testsuites>
27+
<logging>
28+
<junit outputFile="build/report.junit.xml"/>
29+
</logging>
2530
</phpunit>

phpunit9.xml.dist

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
backupGlobals="false"
6+
backupStaticAttributes="false"
7+
colors="true"
8+
verbose="true"
9+
convertErrorsToExceptions="true"
10+
convertNoticesToExceptions="true"
11+
convertWarningsToExceptions="true"
12+
processIsolation="false"
13+
stopOnFailure="false">
14+
<coverage>
15+
<include>
16+
<directory suffix=".php">src/</directory>
17+
</include>
18+
<report>
19+
<clover outputFile="build/logs/clover.xml"/>
20+
<html outputDirectory="build/coverage"/>
21+
<text outputFile="build/coverage.txt"/>
22+
</report>
23+
</coverage>
24+
<testsuites>
25+
<testsuite name="Omnipay Test Suite">
26+
<directory>tests</directory>
27+
</testsuite>
28+
</testsuites>
29+
<logging>
30+
<junit outputFile="build/report.junit.xml"/>
31+
</logging>
32+
</phpunit>

tests/Message/CompletePurchaseResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CompletePurchaseResponseTest extends TestCase
1212
/** @var mixed[] Parsed TxnResp data from a transaction result */
1313
private $responseData;
1414

15-
public function setUp()
15+
public function setUp(): void
1616
{
1717
// demo data from the BPOINT API documentation
1818
$this->responseData = array(

tests/Message/PurchaseRequestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class PurchaseRequestTest extends TestCase
1212
/** @var mixed[] Data to initialize the request with */
1313
private $options;
1414

15-
public function setUp()
15+
public function setUp(): void
1616
{
1717
$this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest());
1818
$this->options = array(

0 commit comments

Comments
 (0)