Skip to content

Commit

Permalink
tests: add phpstan/phpstan-phpunit
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepDiver1975 committed Nov 9, 2023
1 parent c510284 commit 35f5956
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.3",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6"
},
"suggest" : {
"ext-curl" : "*",
Expand Down
7 changes: 7 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tests/Sabre/DAV/ServerEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function afterHandler($path)
public function testAfterResponse()
{
$mock = $this->getMockBuilder('stdClass')
->setMethods(['afterResponseCallback'])
->addMethods(['afterResponseCallback'])
->getMock();
$mock->expects($this->once())->method('afterResponseCallback');

Expand Down
1 change: 1 addition & 0 deletions tests/Sabre/DAVACL/FS/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 35f5956

Please sign in to comment.