Skip to content

Commit

Permalink
Merge pull request #42 from graze/php-8-test
Browse files Browse the repository at this point in the history
Get PHP 8 working
  • Loading branch information
biggianteye authored Apr 14, 2021
2 parents a4daf25 + 595b60e commit f8c2048
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 1,734 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/vendor/
/tests/report/
composer.json.bak
.phpunit.result.cache
composer.lock
20 changes: 14 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,35 @@ cache:
- $HOME/.composer/cache/files

php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
- nightly

env:
- PREFER_LOWEST=--prefer-lowest
- PREFER_LOWEST=
global:
- XDEBUG_MODE=coverage
jobs:
- PREFER_LOWEST=--prefer-lowest
- PREFER_LOWEST=

matrix:
allow_failures:
- php: nightly
- php: 8.0

before_script:
- make ensure-composer-file PHP_VER=$(php -r "echo PHP_VERSION;")
- travis_retry composer update --no-interaction --prefer-dist $PREFER_LOWEST

script:
- vendor/bin/phpcs -p --warning-severity=0 src/ tests/
- vendor/bin/phpunit --coverage-clover=./tests/report/coverage.clover --testsuite unit
- vendor/bin/phpunit --coverage-clover=./tests/report/coverage.clover
--testsuite unit

after_script:
- test -f ./tests/report/coverage.clover && (wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover ./tests/report/coverage.clover)
- test -f ./tests/report/coverage.clover && (wget
https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload
--format=php-clover ./tests/report/coverage.clover)
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL = /bin/sh

DOCKER ?= $(shell which docker)
PHP_VER := 7.2
PHP_VER := 8.0
IMAGE := graze/php-alpine:${PHP_VER}-test
VOLUME := /srv
DOCKER_RUN_BASE := ${DOCKER} run --rm -t -v $$(pwd):${VOLUME} -w ${VOLUME}
Expand Down Expand Up @@ -62,10 +62,11 @@ test-matrix-lowest: ## Test all version, with the lowest version
${MAKE} build-update

test-matrix: ## Run the unit tests against multiple targets.
${MAKE} PHP_VER="5.6" build-update test
${MAKE} PHP_VER="7.0" build-update test
${MAKE} PHP_VER="7.1" build-update test
${MAKE} PHP_VER="7.2" build-update test
${MAKE} PHP_VER="7.3" build-update test
${MAKE} PHP_VER="7.4" build-update test
${MAKE} PHP_VER="8.0" build-update test

test-coverage: ## Run all tests and output coverage to the console.
${MAKE} test-echo
Expand Down
95 changes: 48 additions & 47 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
{
"name": "graze/dog-statsd",
"description": "DataDog StatsD Client",
"keywords": [
"graze",
"dog-statsd",
"statsd",
"datadog",
"dogstatsd"
],
"homepage": "https://github.com/graze/dog-statsd",
"license": "MIT",
"config": {
"platform": {
"php": "7.2"
}
},
"authors": [
{
"name": "Harry Bragg",
"email": "harry.bragg@graze.com",
"role": "Developer"
},
{
"name": "Graze Developers",
"email": "developers@graze.com",
"homepage": "http://www.graze.com",
"role": "Development Team"
}
],
"require": {
"php": "^5.5|^7.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7.21|^6|^7",
"squizlabs/php_codesniffer": "^3",
"johnkary/phpunit-speedtrap": "^1|^2|^3",
"graze/standards": "^2"
},
"autoload": {
"psr-4": {
"Graze\\DogStatsD\\": "src"
}
"name": "graze/dog-statsd",
"description": "DataDog StatsD Client",
"keywords": [
"graze",
"dog-statsd",
"statsd",
"datadog",
"dogstatsd"
],
"homepage": "https://github.com/graze/dog-statsd",
"license": "MIT",
"config": {
"platform": {
"php": "8.0"
}
},
"authors": [
{
"name": "Harry Bragg",
"email": "harry.bragg@graze.com",
"role": "Developer"
},
"autoload-dev": {
"psr-4": {
"Graze\\DogStatsD\\Test\\": "tests/src",
"Graze\\DogStatsD\\Test\\Unit\\": "tests/unit"
}
{
"name": "Graze Developers",
"email": "developers@graze.com",
"homepage": "http://www.graze.com",
"role": "Development Team"
}
],
"require": {
"php": "^7.1|^8.0"
},
"require-dev": {
"phpunit/phpunit": "^7|^8|^9",
"squizlabs/php_codesniffer": "^3.6",
"johnkary/phpunit-speedtrap": "^2|^3",
"graze/standards": "^2"
},
"autoload": {
"psr-4": {
"Graze\\DogStatsD\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Graze\\DogStatsD\\Test\\": "tests/src",
"Graze\\DogStatsD\\Test\\Unit\\": "tests/unit"
}
},
"lock": false
}
Loading

0 comments on commit f8c2048

Please sign in to comment.