From 20e147f40d9d5e41e3781f66b1608da02f1e195e Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Sun, 5 Apr 2020 21:15:19 +0300 Subject: [PATCH 1/2] Update to Codeception 4.x --- composer.json | 2 +- tests/acceptance/TestCase.feature | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 1c5135f..2cac1e2 100755 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "vimeo/psalm": "^3.6.2 || dev-master" }, "require-dev": { - "codeception/base": "^2.5", + "codeception/codeception": "^4.0.3", "squizlabs/php_codesniffer": "^3.3.1", "weirdan/codeception-psalm-module": "^0.4.0" }, diff --git a/tests/acceptance/TestCase.feature b/tests/acceptance/TestCase.feature index 6428f92..1b76693 100644 --- a/tests/acceptance/TestCase.feature +++ b/tests/acceptance/TestCase.feature @@ -69,7 +69,7 @@ Feature: TestCase private $i; /** @return void */ - public function setUp() { + public function setUp(): void { $this->i = $this->prophesize(I::class); } @@ -712,7 +712,7 @@ Feature: TestCase private $i; /** @return void */ - public function setUp() { + public function setUp(): void { $this->i = $this->prophesize(I::class); } @@ -739,7 +739,7 @@ Feature: TestCase protected $i; /** @return void */ - public function setUp() { + public function setUp(): void { $this->i = $this->prophesize(I::class); } } From 63838b8e398b741c4b42189d614388e7c14b1c09 Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Sun, 5 Apr 2020 21:33:48 +0300 Subject: [PATCH 2/2] Bump PHPUnit to 7.5+ Codeception 4.x is not compatible with lower versions --- composer.json | 2 +- src/Plugin.php | 5 +- stubs/Assert.phpstub | 118 ------------------------------ stubs/Assert_75.phpstub | 111 ++++++++++++++++++++++++++++ tests/acceptance/Assert.feature | 42 ----------- tests/acceptance/Assert75.feature | 19 +++++ 6 files changed, 132 insertions(+), 165 deletions(-) delete mode 100644 stubs/Assert.phpstub delete mode 100644 tests/acceptance/Assert.feature diff --git a/composer.json b/composer.json index 2cac1e2..4d3f1b4 100755 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "ext-simplexml": "*", "composer/semver": "^1.4", "ocramius/package-versions": "^1.3", - "phpunit/phpunit": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0", "vimeo/psalm": "^3.6.2 || dev-master" }, "require-dev": { diff --git a/src/Plugin.php b/src/Plugin.php index c34f272..cd3bd08 100755 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -15,10 +15,7 @@ class Plugin implements PluginEntryPointInterface /** @return void */ public function __invoke(RegistrationInterface $psalm, SimpleXMLElement $config = null) { - $psalm->addStubFile(__DIR__ . '/../stubs/Assert.phpstub'); - if ($this->packageVersionIs('phpunit/phpunit', '>=', '7.5')) { - $psalm->addStubFile(__DIR__ . '/../stubs/Assert_75.phpstub'); - } + $psalm->addStubFile(__DIR__ . '/../stubs/Assert_75.phpstub'); $psalm->addStubFile(__DIR__ . '/../stubs/TestCase.phpstub'); $psalm->addStubFile(__DIR__ . '/../stubs/MockBuilder.phpstub'); $psalm->addStubFile(__DIR__ . '/../stubs/InvocationMocker.phpstub'); diff --git a/stubs/Assert.phpstub b/stubs/Assert.phpstub deleted file mode 100644 index 88a86ef..0000000 --- a/stubs/Assert.phpstub +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - """ - And I have the following code preamble - """ -