Skip to content
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

Override class member ordering in test classes #50

Closed
bakerkretzmar opened this issue Jan 4, 2023 · 2 comments · Fixed by #51
Closed

Override class member ordering in test classes #50

bakerkretzmar opened this issue Jan 4, 2023 · 2 comments · Fixed by #51

Comments

@bakerkretzmar
Copy link

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
Copy link
Member

I agree with this.

@driftingly
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants