Can I use this on another non-Drupal project?
Yes, you can. Only the Kernel tests are intimately connected to Drupal, therefor the Client, End to End and Manual tests work just fine on other projects. The Unit test runner can also be configured to work fine on non-Drupal projects.
bootstrap="./test_bootstrap.php"
.Update the paths for testsuites
as appropriate to your project in phpunit.xml, something like:
<testsuites>
<testsuite name="Client">
<directory>./src/Client</directory>
</testsuite>
<testsuite name="EndToEnd">
<directory>./src/EndToEnd</directory>
</testsuite>
<!--Unit tests must come before all Kernel tests.-->
<testsuite name="Unit">
<directory>./src/Unit</directory>
</testsuite>
<testsuite name="Kernel">
<directory>./src/Kernel</directory>
</testsuite>
</testsuites>