From e98bdf1f0eb26552b0adc73a9d9281fb0291466d Mon Sep 17 00:00:00 2001 From: Natan Felles Date: Thu, 4 Jan 2024 16:35:42 -0300 Subject: [PATCH] Upgrade phpunit to version ^10.5 --- .gitignore | 1 + composer.json | 2 +- phpunit.xml.dist | 18 ++++++++++-------- tests/Loggers/FileLoggerTest.php | 6 +++--- tests/Loggers/MultiFileLoggerTest.php | 6 +++--- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 592d95b..d6a2742 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ build/ raw-tests/ vendor/ .php-cs-fixer.cache +.phpunit.cache .phpunit.result.cache composer.lock composer.phar diff --git a/composer.json b/composer.json index 2ec6744..e8b4c78 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "jetbrains/phpstorm-attributes": "^1.0", "phpmd/phpmd": "^2.13", "phpstan/phpstan": "^1.5", - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.5" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 741d40f..905c202 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,13 +1,10 @@ - - - src - + bootstrap="vendor/autoload.php" colors="true" stopOnError="false" stopOnFailure="false" + stopOnIncomplete="false" stopOnSkipped="false" + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" + cacheDirectory=".phpunit.cache"> + @@ -18,4 +15,9 @@ tests + + + src + + diff --git a/tests/Loggers/FileLoggerTest.php b/tests/Loggers/FileLoggerTest.php index 617de37..0409732 100644 --- a/tests/Loggers/FileLoggerTest.php +++ b/tests/Loggers/FileLoggerTest.php @@ -36,10 +36,10 @@ public function testWriteFailure() : void self::assertTrue($this->logger->logCritical('foo')); $destination = \sys_get_temp_dir() . '/tests.log'; \chmod($destination, 0444); - $this->expectError(); + /*$this->expectError(); $this->expectErrorMessage( 'error_log(' . $destination . '): Failed to open stream: Permission denied' - ); - self::assertFalse($this->logger->logCritical('foo')); + );*/ + self::assertFalse(@$this->logger->logCritical('foo')); } } diff --git a/tests/Loggers/MultiFileLoggerTest.php b/tests/Loggers/MultiFileLoggerTest.php index f1a64c1..7f54c1a 100644 --- a/tests/Loggers/MultiFileLoggerTest.php +++ b/tests/Loggers/MultiFileLoggerTest.php @@ -40,11 +40,11 @@ public function testWriteFailure() : void self::assertTrue($this->logger->logCritical('foo')); $dir = \sys_get_temp_dir() . '/logs'; \chmod($dir, 0444); - $destination = $dir . '/' . \date('Y-m-d') . '.log'; + /*$destination = $dir . '/' . \date('Y-m-d') . '.log'; $this->expectError(); $this->expectErrorMessage( 'error_log(' . $destination . '): Failed to open stream: Permission denied' - ); - self::assertFalse($this->logger->logCritical('foo')); + );*/ + self::assertFalse(@$this->logger->logCritical('foo')); } }