[wp-trac] [WordPress Trac] #41871: Code Editor: Add unit tests

WordPress Trac noreply at wordpress.org
Wed Oct 11 02:22:16 UTC 2017


#41871: Code Editor: Add unit tests
--------------------------+------------------
 Reporter:  westonruter   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  high          |   Milestone:  4.9
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------

Comment (by ryotsun):

 Replying to [comment:3 westonruter]:

 Thank you for your advise.
 I'll work on this as soon as possible if it's all right.

 > @ryotsun I'd be looking for tests on `wp_enqueue_code_editor()` that
 passing it the various args it supports (type, file, settings) then get
 result in the expected settings on output, as well as the expected scripts
 and styles being enqueued (note: you'll need to nullify `$wp_scripts` and
 `$wp_styles` for each test.
 >
 > As for how exactly to look at the resulting `$settings`, I'd not suggest
 comparing the entire array but rather look for specific keys and values in
 the array. For example: https://github.com/WordPress/wordpress-
 develop/blob/32224a5c2a7abe7353fd16519e0686aa6603a992/tests/phpunit/tests/customize/manager.php#L2593-L2611

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


More information about the wp-trac mailing list