From 9fb8b91ed3a18cc946bc4b3e08da0ea7f3450ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Thu, 9 Nov 2023 17:48:53 +0100 Subject: [PATCH] tests: add phpstan/phpstan-phpunit (#1506) --- composer.json | 5 +++-- phpstan.neon | 7 +++++++ tests/Sabre/DAVACL/FS/CollectionTest.php | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 7746f46d45..a1296ed0b0 100644 --- a/composer.json +++ b/composer.json @@ -34,9 +34,10 @@ }, "require-dev" : { "friendsofphp/php-cs-fixer": "^2.19", + "monolog/monolog": "^1.27", "phpstan/phpstan": "^0.12 || ^1.0", - "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.6", - "monolog/monolog": "^1.27" + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" }, "suggest" : { "ext-curl" : "*", diff --git a/phpstan.neon b/phpstan.neon index bf76201a5f..2026e1d84b 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,3 +2,10 @@ parameters: level: 1 bootstrapFiles: - tests/bootstrap.php + ignoreErrors: + - + message: '#Trying to mock an undefined method afterResponseCallback\(\) on class stdClass\.#' + path: tests/* +includes: + - vendor/phpstan/phpstan-phpunit/extension.neon + - vendor/phpstan/phpstan-phpunit/rules.neon \ No newline at end of file diff --git a/tests/Sabre/DAVACL/FS/CollectionTest.php b/tests/Sabre/DAVACL/FS/CollectionTest.php index b75dd0c03b..625309ec8f 100644 --- a/tests/Sabre/DAVACL/FS/CollectionTest.php +++ b/tests/Sabre/DAVACL/FS/CollectionTest.php @@ -8,6 +8,7 @@ class CollectionTest extends FileTest { public function setup(): void { + parent::setup(); $this->path = SABRE_TEMPDIR; $this->sut = new Collection($this->path, $this->acl, $this->owner); }