Opened 10 years ago
Closed 10 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 |
---|---|---|---|
Milestone: | 2.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | 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.
We already override
go_to
in 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.