[Wp-unit-tests] [WordPress Unit Tests] #22: get_template_part() tests
WordPress Unit Tests
noreply at wordpress.org
Fri Jul 29 15:16:38 UTC 2011
#22: get_template_part() tests
---------------------------+-----------------
Reporter: aaroncampbell | Owner:
Type: enhancement | Status: new
Priority: major | Milestone:
Component: Capabilities | Version:
Keywords: |
---------------------------+-----------------
I'm going to try to add some test for `get_template_part()` as part of
#wp15086. The problem is that `get_template_part()` uses
`locate_template()` which relies on STYLESHEETPATH and TEMPLATEPATH. I'm
a little unfamiliar still with the way the test suite works, but I didn't
see any obvious way to hook in and tell it to use a different theme.
The problem is that before wp-test.php includes wp-settings.php
`add_(filter|action)` don't exist, and after wp-settings.php has been
included (by the time the test-suite plugins are loaded for example) the
constants have already been defined. What we really need in this case is
an actual active plugin in the actual WordPress plugins directory, because
this is included between the time when actions and filters exist and when
they are used to set the constants we need to change.
Do you guys have a way in place for getting around this that I'm not
seeing?
--
Ticket URL: <http://unit-tests.trac.wordpress.org/ticket/22>
WordPress Unit Tests <http://unit-tests.trac.wordpress.org>
My example project
More information about the wp-unit-tests
mailing list