[wp-trac] [WordPress Trac] #36917: Re-architect wpdb::init_charset() for unit testing

WordPress Trac noreply at wordpress.org
Wed Jun 1 02:37:26 UTC 2016


#36917: Re-architect wpdb::init_charset() for unit testing
----------------------------------------+---------------------
 Reporter:  pento                       |       Owner:  pento
     Type:  task (blessed)              |      Status:  closed
 Priority:  normal                      |   Milestone:  4.6
Component:  Database                    |     Version:
 Severity:  minor                       |  Resolution:  fixed
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+---------------------
Changes (by pento):

 * owner:   => pento
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"37601"]:
 {{{
 #!CommitTicketReference repository="" revision="37601"
 Database: Split the logic of `wpdb::init_charset()` into a separate
 method.

 The logic for determining the appropriate character set and collation to
 use is becoming more complex, particularly with the recent additions of
 [37522] and [37523]. As `init_charset()` has side effects, and makes use
 of constants instead of parameters, it's not possible to unit test this
 logic.

 This commit splits the logic part of `init_charset()` out into a new
 method, `wpdb::determine_charset()`, along with appropriate unit tests.

 See #32105, #37522.

 Fixes #36917.
 }}}

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


More information about the wp-trac mailing list