[wp-trac] [WordPress Trac] #28535: WP Unit Tests should reset hooks after each test
WordPress Trac
noreply at wordpress.org
Sat Jun 21 19:52:29 UTC 2014
#28535: WP Unit Tests should reset hooks after each test
------------------------------+--------------------
Reporter: mnelson4 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.0
Component: Build/Test Tools | Version: trunk
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
------------------------------+--------------------
Comment (by jdgrimes):
Replying to [comment:1 jorbin]:
> This seems like a really good idea to me. We can potentially use the
phpunit option
[http://phpunit.de/manual/3.7/en/appendixes.annotations.html#appendixes.annotations.backupGlobals
backupGlobals] , but I know @nacin mentioned to me once that we tried this
and it caused issues. I'm not sure if that is still the case. It's worth
investigating.
More docs on `backupGlobals`:
http://phpunit.de/manual/current/en/fixtures.html#fixtures.global-state
I don't think we'll be able to use it though. When I try to run a single
test I mocked up, with `backupGlobals` enabled it takes forever (I didn't
wait to see how long it would take to actually run, I killed it after
several minutes). (And yes, it runs fine with `backupGlobals` disabled.) I
think the reason for this is that WordPress's global scope is too heavy.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28535#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list