diff --git a/.gitignore b/.gitignore index 36e61a1..1d570a7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /vendor/ composer.lock .phpunit.result.cache +/composer.phar diff --git a/.travis.yml b/.travis.yml index b85507c..576ddfd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ language: php +php: + - 7.3 services: - docker @@ -10,14 +12,12 @@ cache: before_install: - docker-compose up -d - - docker pull php:7.1-cli - - docker pull php:7.2-cli - docker pull php:7.3-cli - docker pull php:7.4-cli - docker pull php:8.0-cli install: - - composer install + - composer update script: - ./run-tests.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 535beb6..d2c7550 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,17 @@ All notable changes to `powerdns-php` will be documented in this file. Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. ## Unreleased -[Compare v2.6.0 - Unreleased](https://github.com/exonet/powerdns-php/compare/v2.6.0...develop) +[Compare v3.0.0 - Unreleased](https://github.com/exonet/powerdns-php/compare/v3.0.0...develop) + +## [v3.0.0](https://github.com/exonet/powerdns-php/releases/tag/v3.0.0) - 2021-01-05 +[Compare v2.6.0 - v3.0.0](https://github.com/exonet/powerdns-php/compare/v2.6.0...v3.0.0) +### Breaking +- Dropped support for unsupported PHP versions. PHP 7.3 (or newer) is now required. + +### Changed +- Updated Guzzle to 7.2. (@itspluxstahre #50) +- Updated PHPUnit to 9.5.0. +- When running tests a `composer update` will be executed for each environment to validate the packages/config for the specified PHP version. ## [v2.6.0](https://github.com/exonet/powerdns-php/releases/tag/v2.6.0) - 2020-12-21 [Compare v2.5.2 - v2.6.0](https://github.com/exonet/powerdns-php/compare/v2.5.2...v2.6.0) diff --git a/composer.json b/composer.json index 6e5a5ad..e514530 100755 --- a/composer.json +++ b/composer.json @@ -19,14 +19,14 @@ } ], "require": { - "php": ">=7.1", + "php": "^7.3|^8.0", "ext-json": "*", - "guzzlehttp/guzzle": "^6.3", + "guzzlehttp/guzzle": "^7.2", "psr/log": "^1.0" }, "require-dev": { "mockery/mockery": "^1.2", - "phpunit/phpunit": "^7" + "phpunit/phpunit": "^9" }, "autoload": { "psr-4": { @@ -39,7 +39,6 @@ } }, "config": { - "sort-packages": true, - "platform-check": false + "sort-packages": true } } diff --git a/phpunit.xml b/phpunit.xml index 4f42fdb..f56d653 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,20 +1,13 @@ - - - - ./tests - - - - - ./src - - + + + + + ./src + + + + + ./tests + + diff --git a/run-tests.sh b/run-tests.sh index 3873887..4456394 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,3 +1,5 @@ +#!/bin/bash + bold=$(tput bold) red=$(tput setaf 1) green=$(tput setaf 2) @@ -5,7 +7,7 @@ normal=$(tput sgr0) RESULTS="" HAS_FAILED_TESTS=0 -function run() { +run() { PHP_VERSION=$1 PDNS_VERSION=$2 SHORT_PDNS=${PDNS_VERSION//./} @@ -23,9 +25,10 @@ function run() { -e PDNS_HOST="http://pdns" \ --net powerdns-php_default \ -v "$PWD":/usr/src \ + -v "$PWD"/composer.phar:/usr/src/composer.phar \ -w /usr/src/ \ php:"$PHP_VERSION"-cli \ - php ./vendor/bin/phpunit + bash -c './composer.phar -n update && php ./vendor/bin/phpunit' if [ $? -eq 0 ]; then RESULTS="$RESULTS\n${green}✓ PHP $PHP_VERSION / PDNS: $PDNS_VERSION" @@ -41,12 +44,17 @@ function run() { SET_PHP_VERSION=$1 SET_PDNS_VERSION=$2 +# Grab the most recent stable composer. +rm -f composer.phar +curl -L -sS https://getcomposer.org/composer-stable.phar -o composer.phar +chmod +x composer.phar + # If both arguments are given, only run that combo. if [ "$#" -eq 2 ]; then run "$SET_PHP_VERSION" "$SET_PDNS_VERSION" else # Run tests for all supported PHP 7 / PowerDNS 4 combinations. - for phpversion in {1..4}; do + for phpversion in {3..4}; do for pdnsversion in {1..3}; do run "7.$phpversion" "4.$pdnsversion" done diff --git a/src/Connector.php b/src/Connector.php index f86cf9e..1c6ba55 100644 --- a/src/Connector.php +++ b/src/Connector.php @@ -123,7 +123,7 @@ private function makeCall(string $method, string $urlPath, ?string $payload = nu $stream = $payload !== null ? \GuzzleHttp\Psr7\stream_for($payload) : null; $request = new Request($method, $url, $headers, $stream); - $response = $this->httpClient->send($request); + $response = $this->httpClient->send($request, ['http_errors' => false]); return $this->parseResponse($response); }