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
DX: remove recursion from AbstractIntegrationTestCase::testIntegration #7577
DX: remove recursion from AbstractIntegrationTestCase::testIntegration #7577
Conversation
$this->doTest($case); | ||
|
||
// run the test again with the `expected` part, this should always stay the same | ||
$this->doTest( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm mid-mid here.
this approach means whenever someone calling ->doTest()
, they shall always call it twice. I'm not sure if it's good.
(i know there are not so many cases we call it, but imagine we make this AbstractIntegrationTestCase public ultimately, for libraries of custom repos)
maybe they can continue to call it once, and in doTest we do like
function doTest() {
check reqs for PHP...
$this->verifyIntegration($expected, $input); // of course, full IntegrationCase to be passed
$this->verifyIntegration($expected, null);
}
or even
function doTest() {
check reqs for PHP...
foreach ([$epected, $input], [$expected, null])
regular testing logic....
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't the previous implementation even worse? Anyone calling doTest
would also call testIntegration
. We can refactor this later, this one is only about removing recursion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't the previous implementation even worse?
thus I gave the approval, right? ;)
The (re)moved
testIntegration
call was inside ofdoTest
(called in line 148, which is inside oftestIntegration
).