From 14061b1d480cdfa9835e6fd2ae84cbc7206945c4 Mon Sep 17 00:00:00 2001 From: Roy Bongers Date: Thu, 5 Nov 2020 12:03:34 +0100 Subject: [PATCH 1/5] Support Guzzle 7 and drop support for < PHP 7.2 --- composer.json | 8 ++++---- phpunit.xml | 11 ++++------- tests/ApiTest.php | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index 03b904d..bf27586 100644 --- a/composer.json +++ b/composer.json @@ -16,12 +16,12 @@ ], "minimum-stability": "dev", "require": { - "php": ">=5.6", - "guzzlehttp/guzzle": "^6.2" + "php": ">=7.2", + "guzzlehttp/guzzle": "^6.2|^7.0" }, "require-dev": { - "mockery/mockery": "^0.9.5", - "phpunit/phpunit": "~5.7", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^8.0|^9.0", "codeclimate/php-test-reporter": "dev-master" }, "autoload": { diff --git a/phpunit.xml b/phpunit.xml index f280e4c..1761eb6 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,7 +8,6 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" > @@ -20,10 +19,8 @@ ./src/ - - - - + + + + \ No newline at end of file diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 42ef85b..a303c30 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -35,7 +35,7 @@ public function it_uses_organization_for_further_requests() /** @test */ public function it_throws_exception_for_wrong_endpoint() { - $this->setExpectedException(WrongEndpoint::class); + $this->expectException(WrongEndpoint::class); $api = $this->makeApi(); $api->test->getAll(); } From db5cb8fca53e9e2c9daf647d48b5bf07014ca75e Mon Sep 17 00:00:00 2001 From: Roy Bongers Date: Thu, 5 Nov 2020 12:31:20 +0100 Subject: [PATCH 2/5] Remove mininum-stability and php-test-reporter --- composer.json | 8 +++----- phpunit.xml | 10 +++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index bf27586..1deb9d6 100644 --- a/composer.json +++ b/composer.json @@ -14,15 +14,13 @@ "email": "seregazhuk88@gmail.com" } ], - "minimum-stability": "dev", "require": { "php": ">=7.2", - "guzzlehttp/guzzle": "^6.2|^7.0" + "guzzlehttp/guzzle": "^6.2|^7.0", + "phpunit/phpunit": "^9.0" }, "require-dev": { - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^8.0|^9.0", - "codeclimate/php-test-reporter": "dev-master" + "mockery/mockery": "^1.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index 1761eb6..b9b2740 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -19,8 +19,8 @@ ./src/ - - - - - \ No newline at end of file + + + + + From 5ca396266c838277d2022d96515d4947500364ee Mon Sep 17 00:00:00 2001 From: Roy Bongers Date: Thu, 5 Nov 2020 12:39:05 +0100 Subject: [PATCH 3/5] Restore original code coverage --- phpunit.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpunit.xml b/phpunit.xml index b9b2740..be1e966 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -21,6 +21,8 @@ - + From d82b46b7a947ee7d557d7ebf8523170ba0704caa Mon Sep 17 00:00:00 2001 From: Roy Bongers Date: Thu, 5 Nov 2020 12:42:29 +0100 Subject: [PATCH 4/5] PHP unit should be a dev requirement --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 1deb9d6..4137f64 100644 --- a/composer.json +++ b/composer.json @@ -16,11 +16,11 @@ ], "require": { "php": ">=7.2", - "guzzlehttp/guzzle": "^6.2|^7.0", - "phpunit/phpunit": "^9.0" + "guzzlehttp/guzzle": "^6.2|^7.0" }, "require-dev": { - "mockery/mockery": "^1.0" + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^9.0" }, "autoload": { "psr-4": { From 118aed85317c3a07cdb22209fa84749a9ef9b52d Mon Sep 17 00:00:00 2001 From: Roy Bongers <10220797+roy-bongers@users.noreply.github.com> Date: Thu, 5 Nov 2020 15:13:24 +0100 Subject: [PATCH 5/5] Add GitHub action --- .github/workflows/phpunit.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/phpunit.yml diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 0000000..3334e40 --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,33 @@ +name: PHP Composer + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Run test suite + run: ./vendor/bin/phpunit