diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 88543fb..07de108 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -97,6 +97,21 @@ jobs:
dependencies:
- "lowest"
- "highest"
+ phpunit-version:
+ - "^9.5"
+ - "^10.5"
+ - "^11.5"
+ exclude:
+ - php-version: "7.4"
+ phpunit-version: "^10.5"
+ - php-version: "8.0"
+ phpunit-version: "^10.5"
+ - php-version: "7.4"
+ phpunit-version: "^11.5"
+ - php-version: "8.0"
+ phpunit-version: "^11.5"
+ - php-version: "8.1"
+ phpunit-version: "^11.5"
steps:
- name: "Checkout"
@@ -108,6 +123,9 @@ jobs:
coverage: "none"
php-version: "${{ matrix.php-version }}"
+ - name: "Require specific PHPUnit version"
+ run: "composer require --dev phpunit/phpunit:${{ matrix.phpunit-version }}"
+
- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"
@@ -136,6 +154,21 @@ jobs:
dependencies:
- "lowest"
- "highest"
+ phpunit-version:
+ - "^9.5"
+ - "^10.5"
+ - "^11.5"
+ exclude:
+ - php-version: "7.4"
+ phpunit-version: "^10.5"
+ - php-version: "8.0"
+ phpunit-version: "^10.5"
+ - php-version: "7.4"
+ phpunit-version: "^11.5"
+ - php-version: "8.0"
+ phpunit-version: "^11.5"
+ - php-version: "8.1"
+ phpunit-version: "^11.5"
steps:
- name: "Checkout"
@@ -149,6 +182,9 @@ jobs:
extensions: mbstring
tools: composer:v2
+ - name: "Require specific PHPUnit version"
+ run: "composer require --dev phpunit/phpunit:${{ matrix.phpunit-version }}"
+
- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"
diff --git a/composer.json b/composer.json
index 212c518..be6b3bd 100644
--- a/composer.json
+++ b/composer.json
@@ -13,15 +13,13 @@
"phpunit/phpunit": "<7.0"
},
"require-dev": {
+ "nikic/php-parser": "^5",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^9.6"
},
"config": {
- "platform": {
- "php": "7.4.6"
- },
"sort-packages": true
},
"extra": {
diff --git a/phpunit.xml b/phpunit.xml
index 8f71615..420ef74 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -12,20 +12,6 @@
failOnWarning="true"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xml"
>
-
-
- ./src
-
-
-
-
-
-
-
tests
diff --git a/tests/Type/PHPUnit/AssertFunctionTypeSpecifyingExtensionTest.php b/tests/Type/PHPUnit/AssertFunctionTypeSpecifyingExtensionTest.php
index 2d43f8b..4405c4d 100644
--- a/tests/Type/PHPUnit/AssertFunctionTypeSpecifyingExtensionTest.php
+++ b/tests/Type/PHPUnit/AssertFunctionTypeSpecifyingExtensionTest.php
@@ -9,14 +9,14 @@ class AssertFunctionTypeSpecifyingExtensionTest extends TypeInferenceTestCase
{
/** @return mixed[] */
- public function dataFileAsserts(): iterable
+ public static function dataFileAsserts(): iterable
{
if (function_exists('PHPUnit\\Framework\\assertInstanceOf')) {
- yield from $this->gatherAssertTypes(__DIR__ . '/data/assert-function.php');
+ yield from self::gatherAssertTypes(__DIR__ . '/data/assert-function.php');
}
if (function_exists('PHPUnit\\Framework\\assertObjectHasProperty')) {
- yield from $this->gatherAssertTypes(__DIR__ . '/data/assert-function-9.6.11.php');
+ yield from self::gatherAssertTypes(__DIR__ . '/data/assert-function-9.6.11.php');
}
return [];
diff --git a/tests/Type/PHPUnit/AssertMethodTypeSpecifyingExtensionTest.php b/tests/Type/PHPUnit/AssertMethodTypeSpecifyingExtensionTest.php
index e1841e0..0b36c2b 100644
--- a/tests/Type/PHPUnit/AssertMethodTypeSpecifyingExtensionTest.php
+++ b/tests/Type/PHPUnit/AssertMethodTypeSpecifyingExtensionTest.php
@@ -8,9 +8,9 @@ class AssertMethodTypeSpecifyingExtensionTest extends TypeInferenceTestCase
{
/** @return mixed[] */
- public function dataFileAsserts(): iterable
+ public static function dataFileAsserts(): iterable
{
- yield from $this->gatherAssertTypes(__DIR__ . '/data/assert-method.php');
+ yield from self::gatherAssertTypes(__DIR__ . '/data/assert-method.php');
}
/**
diff --git a/tests/Type/PHPUnit/data/assert-function.php b/tests/Type/PHPUnit/data/assert-function.php
index 851e07b..0fabf59 100644
--- a/tests/Type/PHPUnit/data/assert-function.php
+++ b/tests/Type/PHPUnit/data/assert-function.php
@@ -53,12 +53,6 @@ public function arrayHasStringKey(array $a, \ArrayAccess $b): void
assertType("ArrayAccess", $b);
}
- public function objectHasAttribute(object $a): void
- {
- assertObjectHasAttribute('property', $a);
- assertType("object&hasProperty(property)", $a);
- }
-
public function testEmpty($a): void
{
assertEmpty($a);