[wp-trac] [WordPress Trac] #29839: Enhance get_terms to return only bottom child terms (terms without children) when taxonomy is heirarchical

WordPress Trac noreply at wordpress.org
Thu Nov 13 03:22:03 UTC 2014


#29839: Enhance get_terms to return only bottom child terms (terms without
children) when taxonomy is heirarchical
-------------------------------------------------+-------------------------
 Reporter:  theMikeD                             |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Taxonomy                             |  Review
 Severity:  normal                               |     Version:  4.0
 Keywords:  good-first-bug has-patch needs-      |  Resolution:
  unit-tests                                     |     Focuses:
-------------------------------------------------+-------------------------

Comment (by boonebgorges):

 >  I'd be happy to do a unit test if you can point me at some docs on how
 I'd go about doing that. Would it be helpful to write out the unit tests
 in logic here first, or just do them and address omissions at a later
 date?

 Sure thing. Here's a guide to getting set up with PHPUnit:
 https://make.wordpress.org/core/handbook/automated-testing/ As for the
 tests themselves, have a look at the existing tests for `get_terms()`:
 https://core.trac.wordpress.org/browser/trunk/tests/phpunit/tests/term/getTerms.php.
 Find one that does something similar to what you are trying to test, then
 copy and modify it :) I'm happy to lend a hand with that if you hit a
 snag.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29839#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list