Improve docs around setUp and setUpBeforeClass
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Domain
- documentation
Research direction
Open docs/en/02_Developer_Guides/06_Testing/00_Unit_Testing.md and review the setUp and setUpBeforeClass sections, using the linked blame context. Confirm the current SapphireTest method visibility and document the setup caveats described in the issue; done means the guidance is accurate and clearly warns about test-state persistence.
Written by the indexing model from the issue text.
Description
Description
The docs for setUp and tearDown in SapphireTest are incorrect as these methods are protected now.
Additionally the docs have a section about using setUpBeforeClass in your tests:
https://github.com/silverstripe/silverstripe-framework/blame/4/docs/en/02_Developer_Guides/06_Testing/00_Unit_Testing.md#L140 (blame because there's no line-number view for markdown files 😞 )
This doesn't mention any of the caveats of using this like certain scaffolding not being ready yet - the example from community Slack being you can't Security::setCurrentUser. Personally I would generally discourage use of it in most cases as test state should not persist between individual tests.
Either way that section could be improved to warn developers better.
- Dominant language
- No language data
- Stars
- 7
- Forks
- 74
- Avg merge
- 1d 14m
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from silverstripe/developer-docs
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#911 ·
-
Read-only replicas: config key is rule_patterns_must_use_primary_db, not must_use_primary_db_rules Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
silverstripe/developer-docs#909 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
silverstripe/developer-docs#908 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
silverstripe/developer-docs#907 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#903 ·
All issues in silverstripe/developer-docs
Similar issues
-
sync-en
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agilepathway/label-checker#640 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
BasedHardware/omi#15662 · 1 comment ·
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100