diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1620ca7..17058da 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,6 +10,14 @@ jobs: matrix: include: - php-version: '7.4' + - php-version: '8.0' + - php-version: '8.1' + - php-version: '8.2' + - php-version: '8.3' + - php-version: '8.4' + phpunit-flags: --display-deprecations --fail-on-deprecation + - php-version: '8.5' + phpunit-flags: --display-deprecations --fail-on-deprecation runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 @@ -17,6 +25,12 @@ jobs: - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - extensions: none + extensions: none, ctype, curl, dom, json, mbstring, tokenizer, xml, xmlwriter + ini-values: display_errors=On, display_startup_errors=On, error_reporting=-1, zend.assertions=1 - - run: php --version + - run: composer update + + - if: matrix.php-version != '7.4' && matrix.php-version != '8.0' # These run PHPUnit 9, which does not have the option + run: vendor/bin/phpunit --check-php-configuration + + - run: vendor/bin/phpunit tests --no-configuration ${{ matrix.phpunit-flags }} diff --git a/composer.json b/composer.json index 32f29ef..29b005b 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "php": "^5.6 || ^7.0 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^5.1" + "phpunit/phpunit": "^9.6.24 || ^10.5.52 || ^11.5.33" }, "config": { "optimize-autoloader": true, diff --git a/src/AccessibleObject.php b/src/AccessibleObject.php index 540e8a7..5bc6cd1 100644 --- a/src/AccessibleObject.php +++ b/src/AccessibleObject.php @@ -36,7 +36,7 @@ public function __call($name, array $arguments) } $method = $this->reflection->getMethod($name); - $method->setAccessible(true); + PHP_VERSION_ID < 80100 && $method->setAccessible(true); return $method->invokeArgs($this->object, $arguments); } @@ -59,7 +59,7 @@ public function __get($name) } $property = $this->reflection->getProperty($name); - $property->setAccessible(true); + PHP_VERSION_ID < 80100 && $property->setAccessible(true); return $property->getValue($this->object); } @@ -71,7 +71,7 @@ public function __set($name, $value) } $property = $this->reflection->getProperty($name); - $property->setAccessible(true); + PHP_VERSION_ID < 80100 && $property->setAccessible(true); $property->setValue($this->object, $value); }