-
Notifications
You must be signed in to change notification settings - Fork 13
WIZ-11443 Fix inheritance with phpunit #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I tried this out, but couldn't get it to work:
What I tried it:
Maybe I did something wrong, not sure what a better way would be to test this. My <?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
cacheResult="false"
failOnWarning="true"
executionOrder="random"
>
<testsuites>
<testsuite name="Application Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
</phpunit> |
I just tested it on my local environment and I got the same error on PHP 8. I'm looking into it... |
It's working fine now. Just a missing file in my commits. Updated the tests as well. |
Yes, seems to work now 😱 |
Due to incompatibility with phpunit > 7
We cannot extend anymore from
PHPUnit\TextUI\TestRunner
which is nowfinal
.In order to get the right number of tests in the
PHPUnit\TextUI\TestSuite
we can apply the slice directly in theCommand
.Now it is the function
handleArguments
ofPHPUnit\TextUI\Command
which is overriden. This function parses the arguments and creates thePHPUnit\TextUI\TestSuite
instance. So after that, we can slice and reset the tests in the TestSuite. It will be this modified TestSuite which will be given to therun
function.Therefore, we do not need anymore the
TestRunner.php
file, nor the override of thecreateRunner
function.NB: I also removed the unbreakable spaces in the tests files.