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

WordPress Trac noreply at wordpress.org
Tue Oct 10 21:12:47 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 westonruter):

 @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:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list