[wp-trac] [WordPress Trac] #26999: Improve the layout of phpunit unit tests to gauge code coverage

WordPress Trac noreply at wordpress.org
Mon Jan 26 18:58:24 UTC 2015


#26999: Improve the layout of phpunit unit tests to gauge code coverage
------------------------------------------+-----------------------------
 Reporter:  wonderboymusic                |       Owner:
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  Build/Test Tools              |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+-----------------------------

Comment (by sgrant):

 I took a crack at refactoring the structure in relation to the source
 (what a great way to learn about WP history!)

 https://github.com/scotchfield/wp-phpunit

 This layout seems easier to understand (at least to me), and it seems
 clear where new tests could be added in the future. However, there are a
 lot of test classes that don't map well to files; they test functionality
 instead of individual functions. For example, the directories with
 multiple files often have classes that define specific setUp and tearDown
 functions, and pulling all of those into a single class for the file in
 question might bloat the pre/post work.

 Also, many of the tests that were just dumped in general could be
 refactored out to show coverage.

 There are still a few small issues in the repo, but it's one possible way
 to consider the tests.

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


More information about the wp-trac mailing list