| Q | A
| --------------------| ---------------
| PHPUnit version | 8.5.0
| PHP version | 7.3.12
| Installation Method | PHAR
Method PHPUnit\Framework\TestCase::__constructor
is marked as internal with this message:
@internal This method is not covered by the backward compatibility promise for PHPUnit
Method is marked as internal, seemingly just to signal it not being covered by BC.
But it's not actually internal since it's intended to be used by the fast you extend TestCase
in your own suites.
The usage of internal methods is reported by running Psalm on your tests:
ERROR: InternalMethod - tests/Xezilaires/Bridge/PhpSpreadsheet/RowIteratorTest.php:28:37 - The method PHPUnit\Framework\TestCase::__construct has been marked as internal
final class RowIteratorTest extends TestCase
Run Psalm on your tests backed by PHPUnit 8.5.0.
Method(s) which are intended to be used by the tests shouldn't be marked as internal.
Just found another one:
ERROR: InternalMethod - tests/Xezilaires/SpreadsheetIteratorTest.php:123:30 - The method PHPUnit\Framework\MockObject\Builder\InvocationMocker::willReturn has been marked as internal
$mocker->willReturn($spec['return']);
I do not know where you get the idea that PHPUnit\Framework\TestCase::__constructor()
is intended to be used in your own tests.
It's not used directly, but the ctor is invoked just by extending TestCase
, no? So basically any test case out there is using an internal method by default.