Opened 12 years ago
Closed 12 years ago
#5965 closed defect (bug) (fixed)
test suite doesn't reset globals if go_to() is used twice in one test
| Reported by: | DJPaul | Owned by: | djpaul |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.2 |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
The unit test suite doesn't reset all BP's globals if go_to is used twice in one test. There aren't many places this happens in existing core tests (test_visibility_private is one instance), I discovered this while writing tests for #5865.
We rely on clean_up_global_scope to tidy up, and WordPress calls that method during each test's setUp method -- which is fine, assuming each test only uses go_to once.
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
We already override
go_toin our test suite so I'm going to add in a call toclean_up_global_scope.Writing tests to test our test suite seems a bit meta, but you can demo the bug like this:
vs.