Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.

Commit de79a3a

Browse files
committed
Add PHP 8.0 support, raise min to PHP 7.3
Upgrade to PHPUnit 9.5 for that.
1 parent 0364835 commit de79a3a

18 files changed

+63
-43
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
tests:
1111
strategy:
1212
matrix:
13-
php-versions: ['7.2', '7.3', '7.4']
13+
php-versions: ['7.3', '7.4', '8.0', '8.1']
1414

1515
runs-on: ubuntu-latest
1616

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
vendor/
2+
.phpunit.result.cache
23
composer.lock
34
!bin/php
45
!build/.gitkeep

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG PHP_VERSION=7.1
1+
ARG PHP_VERSION=8.0
22

33
FROM php:${PHP_VERSION}-cli-alpine
44

5-
ARG XDEBUG_VERSION=2.7.0RC1
5+
ARG XDEBUG_VERSION=3.1.5
66

77
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
88
&& apk add --no-cache --virtual .runtime-deps git libzip-dev \

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ MAKEFLAGS =+ -rR --warn-undefined-variables
44
.PHONY: composer-install composer-update examples docker run
55

66
COMPOSER ?= bin/composer.phar
7-
COMPOSER_VERSION ?= 1.8.3
7+
COMPOSER_VERSION ?= 2.3.8
88
PHP ?= bin/php
9-
PHP_VERSION ?= 7.2
10-
XDEBUG_VERSION ?= 2.7.0RC1
9+
PHP_VERSION ?= 8.0
10+
XDEBUG_VERSION ?= 3.1.5
1111

1212
export
1313

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A library for using [Avro](http://avro.apache.org/) with PHP.
77

88
Requirements
99
============
10-
* PHP >= 7.1
10+
* PHP >= 7.3
1111
* On 32-bit platforms, the [GMP PHP extension](http://php.net/gmp)
1212
* For testing, [PHPUnit](http://www.phpunit.de/)
1313

bin/php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ command -v docker >/dev/null 2>&1 || { echo "docker is required to run this bina
77
USER=${USER:-$( id -un )}
88
GROUP=${GROUP:-$( id -gn )}
99
COMPOSER_HOME=${COMPOSER_HOME:-${HOME}/.composer}
10-
PHP_VERSION=${PHP_VERSION:-7.1}
10+
PHP_VERSION=${PHP_VERSION:-8.0}
1111
DOCKER_OPTS=${DOCKER_OPTS:-'-it'}
1212

1313
exec docker run ${DOCKER_OPTS} --rm \

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"description": "Composer packaging for vanilla Apache Avro, with fixes",
44
"license": "Apache-2.0",
55
"require": {
6-
"php": ">=7.1"
6+
"php": ">=7.3"
77
},
88
"require-dev": {
9-
"phpunit/phpunit": "^5.0"
9+
"phpunit/phpunit": "^9.5"
1010
},
1111
"suggest": {
1212
"ext-gmp": "Large integer support for 32-bit platforms."

test/DataFileTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
* limitations under the License.
1818
*/
1919

20+
use PHPUnit\Framework\TestCase;
21+
2022
require_once('test_helper.php');
2123

2224
/**
2325
* Class DataFileTest
2426
*/
25-
class DataFileTest extends PHPUnit_Framework_TestCase
27+
class DataFileTest extends TestCase
2628
{
2729
private $data_files;
2830
const REMOVE_DATA_FILES = true;
@@ -62,13 +64,13 @@ protected function remove_data_files()
6264
$this->remove_data_file($data_file);
6365
}
6466

65-
protected function setUp()
67+
protected function setUp(): void
6668
{
6769
if (!file_exists(TEST_TEMP_DIR))
6870
mkdir(TEST_TEMP_DIR);
6971
$this->remove_data_files();
7072
}
71-
protected function tearDown()
73+
protected function tearDown(): void
7274
{
7375
$this->remove_data_files();
7476
}

test/DatumIOTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
* limitations under the License.
1818
*/
1919

20+
use PHPUnit\Framework\TestCase;
21+
2022
require_once('test_helper.php');
2123

2224
/**
2325
* Class DatumIOTest
2426
*/
25-
class DatumIOTest extends PHPUnit_Framework_TestCase
27+
class DatumIOTest extends TestCase
2628
{
2729
/**
2830
* @dataProvider data_provider

test/FileIOTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@
1717
* limitations under the License.
1818
*/
1919

20+
use PHPUnit\Framework\TestCase;
21+
2022
require_once('test_helper.php');
2123

2224
/**
2325
* Tests against a preexisting file created by a different library
2426
*/
25-
class FileIOTest extends PHPUnit_Framework_TestCase
27+
class FileIOTest extends TestCase
2628
{
27-
protected function tearDown()
29+
protected function tearDown(): void
2830
{
2931
$file = $this->getTmpFile();
3032
if (file_exists($file))

0 commit comments

Comments
 (0)