Skip to content

Commit

Permalink
Run phan's bootstrap in PHPUnit tests
Browse files Browse the repository at this point in the history
This is needed for proper initialization of phan. In particular, it
installs phan's error handler, which suppressed PHP Deprecated warnings
seen in CI when phan loads the list of PHP constants.

Change-Id: Ic26950d5f4b4859c8ca32920fdaf0d9995ff46af
  • Loading branch information
Daimona committed Oct 24, 2023
1 parent 679ac25 commit ffd0091
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
backupStaticAttributes="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="tests/bootstrap.php">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
Expand Down
3 changes: 3 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

require_once __DIR__ . '/../vendor/phan/phan/src/Phan/Bootstrap.php';

0 comments on commit ffd0091

Please sign in to comment.