From 7d18b366eef4977a81a7a0207deefdbac3ca7b4a Mon Sep 17 00:00:00 2001 From: Adrian Suter Date: Wed, 2 Mar 2022 09:39:08 +0100 Subject: [PATCH 1/4] Update dev dependencies. --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 876c142..f8561e6 100644 --- a/composer.json +++ b/composer.json @@ -38,9 +38,9 @@ "nikic/php-parser": "^4.4" }, "require-dev": { - "phpstan/phpstan": "^0.12 || ^1.0", - "phpunit/phpunit": "^8.5 || ^9.3", - "squizlabs/php_codesniffer": "^3.5" + "phpstan/phpstan": "^1.4", + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "^3.6" }, "scripts": { "test": [ From f6536a94513dc537e96e6f8bbd629fd27d1e1597 Mon Sep 17 00:00:00 2001 From: Adrian Suter Date: Wed, 2 Mar 2022 09:46:43 +0100 Subject: [PATCH 2/4] Fix prophet. --- composer.json | 1 + phpunit.xml.dist | 42 +++++++++++++------------------------ tests/CodeConverterTest.php | 3 +++ tests/OverrideTest.php | 3 +++ 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/composer.json b/composer.json index f8561e6..b796403 100644 --- a/composer.json +++ b/composer.json @@ -40,6 +40,7 @@ "require-dev": { "phpstan/phpstan": "^1.4", "phpunit/phpunit": "^9.5", + "phpspec/prophecy-phpunit": "^2.0", "squizlabs/php_codesniffer": "^3.6" }, "scripts": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5f44a59..6c6365d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,29 +1,17 @@ - - - - - ./tests/ - - - - - - src/ - - - - - - - + + + + src/ + + + + + + + + ./tests/ + + + diff --git a/tests/CodeConverterTest.php b/tests/CodeConverterTest.php index 8c94678..e878f77 100644 --- a/tests/CodeConverterTest.php +++ b/tests/CodeConverterTest.php @@ -14,11 +14,14 @@ use PhpParser\Parser; use PHPUnit\Framework\TestCase; use Prophecy\Argument; +use Prophecy\PhpUnit\ProphecyTrait; use Prophecy\Prophecy\MethodProphecy; use RuntimeException; class CodeConverterTest extends TestCase { + use ProphecyTrait; + public function testConvert(): void { $converter = new CodeConverter(); diff --git a/tests/OverrideTest.php b/tests/OverrideTest.php index f2ee4f7..04a2a87 100644 --- a/tests/OverrideTest.php +++ b/tests/OverrideTest.php @@ -16,6 +16,7 @@ use Composer\Autoload\ClassLoader; use PHPUnit\Framework\TestCase; use Prophecy\Argument; +use Prophecy\PhpUnit\ProphecyTrait; use Prophecy\Prophecy\MethodProphecy; use ReflectionMethod; use ReflectionProperty; @@ -26,6 +27,8 @@ */ class OverrideTest extends TestCase { + use ProphecyTrait; + public function testSetCodeConverter() { $converter = $this->createMock(CodeConverter::class); From a95453951be84a42df34af676c772053061e4733 Mon Sep 17 00:00:00 2001 From: Adrian Suter Date: Wed, 2 Mar 2022 09:55:05 +0100 Subject: [PATCH 3/4] Drop support for php 7.2. --- .github/workflows/tests.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 638cb71..7648539 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ 7.2, 7.3, 7.4, 8.0 ] + php: [ 7.3, 7.4, 8.0 ] experimental: [ false ] include: - php: 8.0 diff --git a/composer.json b/composer.json index b796403..b56a5d3 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ ] }, "require": { - "php": "^7.2 || ^8.0", + "php": "^7.3 || ^8.0", "nikic/php-parser": "^4.4" }, "require-dev": { From 68394e8dcd5175b606289f6c2061a62942e19402 Mon Sep 17 00:00:00 2001 From: Adrian Suter Date: Wed, 2 Mar 2022 10:03:01 +0100 Subject: [PATCH 4/4] Add support for php 8.1. --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7648539..3a95cec 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,10 +10,10 @@ jobs: strategy: fail-fast: false matrix: - php: [ 7.3, 7.4, 8.0 ] + php: [ 7.3, 7.4, 8.0, 8.1 ] experimental: [ false ] include: - - php: 8.0 + - php: 8.1 analysis: true steps: