Skip to content

Commit

Permalink
Update discovering-symbols.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed May 27, 2023
1 parent 3b6bd74 commit 60f9a44
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions website/src/user-guide/discovering-symbols.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,21 @@ parameters:
```

Please note that the file with the autoloader will actually be executed by the PHP runtime.

PHPUnit as a PHAR
---------------------------

When you install [PHPUnit](https://phpunit.de/) with [Phive](https://github.com/phar-io/phive), you might encounter similar errors when analysing your tests with PHPStan:

* Class `App\MyTest` extends unknown class `PHPUnit\Framework\TestCase`.
* Call to an undefined static method `App\MyTest::assertIsArray()`.

That's because PHPStan does not see PHPUnit classes from inside `phpunit.phar`.

The way to fix it is to put `phpunit.phar` in `bootstrapFiles` in your [configuration file](/config-reference):

```yaml
parameters:
bootstrapFiles:
- tools/phpunit.phar
```

0 comments on commit 60f9a44

Please sign in to comment.