tighten/duster

Override class member ordering in test classes

Closed this issue · 2 comments

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?

I agree with this.

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.