PHPUnit errors occur when running drupal-check
The first warning could make you think PHPUnit isn't installed, but since drupal-check is able to tell you that the declaration of Drupal\Tests\BrowserTestBase::setUp() is not compatible with the declaration of PHPUnit\Framework\TestCase::setUp(), that is not the case. If PHPUnit weren't installed, drupal-check would report more missing classes.

PHPUnit is installed, but it's version 9.0.0 or higher version, where:


The PHPUnit\Framework\MockObject\Matcher\InvokedRecorder class doesn't exist (but it's defined in PHPUnit 8.0.0)
The PHPUnit\Framework\TestCase::setUp() method is defined as setUp(): void, while PHPUnit 7 defines it as setUp() (The difference is enough to cause the fatal error.)


So, in short:


The installed version of PHPUnit is at least 9
The Drupal version you installed still requires PHPUnit 7


Notice that, so far, only Drupal 9.x has been updated to PHPUnit 8, and in future it will support PHPUnit 9. Previous Drupal versions still need PHPUnit 7, and eventually they will be updated to support PHPUnit 8.