Closed (fixed)
Project:
Flag
Version:
8.x-4.x-dev
Component:
Flag core
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2015 at 19:50 UTC
Updated:
19 Jun 2015 at 20:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
joachim commentedFound a few other problems with our tests on the way; filed other issues.
Comment #2
martin107 commentedAll the changes so far are really good.
This maybe a separate issue to carve off.
Is there a reason we call function of the form doMyTests()
from within testFlagForm() when the convention is that all methods prefixed with test will be executed.
I suspect it is because the order in which the do functions are called is critical, and this is a code smell...
Separately it looks like the following steps are common the majority of the function are could be moved in a setup function for better maintainability.
1) $node = $this->drupalCreateNode(['type' => $this->nodeType]);
2) Give persmiisions
3) create user. and login
Anyway for the moment I am just rerolling, because an issue that was solved here was solved in isolation #2482123: FlagSimpletest - do not continue the process.
.
Comment #3
joachim commented> Is there a reason we call function of the form doMyTests()
from within testFlagForm() when the convention is that all methods prefixed with test will be executed.
Yes, the reason is that a method of the form testFoo() is run in a brand new test setup. So splitting up the test code into testFoo(), testBar() will slow the test down. In many cases it's just that we want to split the code up for clarity, because it tests different parts, but a fresh site isn't necessary. At least, that's my understanding.
> Separately it looks like the following steps are common the majority of the function are could be moved in a setup function for better maintainability.
I think there's an issue open to refactor the tests for more code re-use.
Thanks for the reroll :)
Comment #4
socketwench commentedNeeds a reroll, but other than that changes look good to RTBC.
Comment #5
joachim commentedThanks!