[wp-trac] [WordPress Trac] #26475: Hierarchical meta box display issues when messing around with new terms
WordPress Trac
noreply at wordpress.org
Tue Mar 17 15:13:38 UTC 2015
#26475: Hierarchical meta box display issues when messing around with new terms
--------------------------+-----------------------------
Reporter: ericlewis | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Taxonomy | Version: 3.8
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+-----------------------------
Comment (by boonebgorges):
Yeah, writing tests for this kind of thing is pretty terrible.
Instead of testing the entire HTML output, we can have more focused tests
using `assertContains()` and `assertRegExp()`. Still not great, but at
least not quite as fragile. See eg
https://core.trac.wordpress.org/browser/trunk/tests/phpunit/tests/comment/commentForm.php.
I'm not opposed to separating the term hierarchy logic here (and in fact,
we have `_get_term_hierarchy()`, which could be used to do most of the
work, I think), but we'll still have to do some tree-walking when building
the HTML. So there won't be a great deal of code simplification, though
certainly we'll make up for it in DRYness and probably even in performance
(since `_get_term_hierarchy()` grabs a cached array from the options
table).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26475#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list