-
-
Notifications
You must be signed in to change notification settings - Fork 673
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
PHPUnit Declaration must be compatible #1012
Comments
How does Enlight_Components_Test_TestCase::tearDown() look like? |
protected function tearDown()
{
if ($this->databaseTester !== null) {
if (method_exists($this, 'getTearDownOperation')) {
$this->getDatabaseTester()->setTearDownOperation($this->getTearDownOperation());
}
if (method_exists($this, 'getDataSet')) {
$this->getDatabaseTester()->setDataSet($this->getDataSet());
}
$this->getDatabaseTester()->onTearDown();
}
$this->databaseTester = null;
set_time_limit(0);
ini_restore('memory_limit');
} It don't have the return type void. I guess that the tool would add it :) |
Looks good, it should work.
|
Yea its multiple times extended from another test cases.
Abstract TestCase class on Github https://github.com/shopware/shopware/blob/5.5/engine/Library/Enlight/Components/Test/TestCase.php#L69 |
I see. I think Since it doesn't have a namespace, it might be missed. I'd try to add it explicitly to |
Oh, I see it's |
I've added test case here and it passes: https://github.com/rectorphp/rector/pull/1015/files#diff-0046f116fcc7847008b98b058947e8e7 Ano more idea - I use PHPUnit 7.5. If you upgrade to never PHPUnit 8, it will match to your old code to new one and failing in I'd try Rector run first, then upgrade to PHPUnit 8, when the code is ready. |
I was before on PHPUnit 6 and upgraded directly to 8 :) |
That's the problem :) |
rectorphp/rector-src@8bb31f2 [automated] Re-Generate Nodes/Rectors Documentation (#1012)
I am upgrading a test suite from PHPUnit 6 to 8. A run rector over it.
My expectation was that he fixes all return types issue. But it hangs with a Fatal Error
Fatal error: Declaration of Enlight_Components_Test_TestCase::tearDown() must be compatible with PHPUnit\Framework\TestCase::tearDown(): void
The text was updated successfully, but these errors were encountered: