Override class member ordering in test classes
Closed this issue · 2 comments
bakerkretzmar commented
Not sure if this is a bug or a feature request—setUp()
and tearDown()
are protected
but should (I think?) be at the top of the test class for clarity. Thoughts?
driftingly commented
I agree with this.
driftingly commented
There's a phpunit
parameter we can use:
https://cs.symfony.com/doc/rules/class_notation/ordered_class_elements.html
Uses the following order:
'setupbeforeclass' => 1,
'dosetupbeforeclass' => 2,
'teardownafterclass' => 3,
'doteardownafterclass' => 4,
'setup' => 5,
'dosetup' => 6,
'assertpreconditions' => 7,
'assertpostconditions' => 8,
'teardown' => 9,
'doteardown' => 10,
I'll look at updating this tomorrow.