[wp-hackers] Unit Testing

Mike Schinkel mikeschinkel at newclarity.net
Thu Jan 26 23:11:53 UTC 2012

On Jan 26, 2012, at 4:07 PM, Stas Sușcov wrote:

> I believe this thread was started by simply not being aware of existing tests for WordPress and the coverage of those.

As far as I can tell from a Google search[1] and from answers on 4 questions[2] at StackExchange's WordPress Answers, there are really only a total of 7 other pages[3-9] on the web about Unit Testing for WordPress. 7 pages out of 60+ million blogs and billions(?) of total web pages generated by users of WordPress software.

7.  Total.  Pages!

Earth has a better chance of a catastrophic asteroid collision[10] than we have of finding useful unit testing information about WordPress on the web.

And 1 is a readme, 2 are home pages for a trac and svn sites, respectively, 2 are codex pages with at best linked example, 1 minimal coding how-to from the guy's at Chicago Tribune's ChicagoNow.com (IOW, nobody directly related to the WordPress core team.) The only reasonabke good one if from Nikolay Bachiyski on WordPress.tv, and it is a video.  IOW, 1 reasonable how-to which being a video doesn't even allow you to copy the code. Out of billions of web pages.

I'm not pointing fingers at *anyone* for *not* having done more. My team has badly needed to implement unit tests for our internal framework and sites built using it but we have yet to have the time to devote the minimum of 1-2 weeks to research and build proof-of-concepts to allow us to discover best practices for WordPress unit testing. 

But I *am* saying Wojtek is neither an idiot nor a jerk for asking about unit tests, and I feel confident all the +1's were in part because of the dearth of how-to information and best practices about unit testing WordPress projects. So I for one would applaud *any* efforts to emerge how-to information and best practices for unit testing on WordPress related projects.


[1] http://www.google.com/searchq=unit+tests+for+wordpress
[2] http://wordpress.stackexchange.com/search?q=unit+[testing]
[3] http://unit-tests.trac.wordpress.org/
[4] http://codex.wordpress.org/Automated_Testing
[5] http://unit-test.svn.wordpress.org/README.txt
[6] http://codex.wordpress.org/User:Hakre/WP_Unit-Tests
[7] http://svn.automattic.com/wordpress-tests/
[8] http://wordpress.tv/2011/08/20/nikolay-bachiyski-unit-testing-will-change-your-life/
[9] http://blog.apps.chicagotribune.com/2011/06/28/dont-break-the-homepage-using-unit-tests-to-validate-your-wordpress-varnish-caching-strategy/	
[10] Okay, I made that part up.

> I would raise this question again after checking resources that Aaron already posted, and the answer you will discover (probably on your own) is "Patches welcome!".
> What I would really love to see, is a travis-ci or some other CI setup for a real-time overview of current codebase modifications.
> Also +1 for adoption of some JavaScript testing framework and adding some tests for UI/UX responsible code.
> În data de Thu, 26 Jan 2012 21:14:21 +0200, Aaron Jorbin <aaron at jorb.in> a scris:
>> On Thu, Jan 26, 2012 at 2:02 PM, Wojtek Szkutnik <wojtek.szkutnik at gmail.com>
>> wrote:
>>> Seems like we have a winner :) Do you guys have any specific parts of WP
>>> that you'd like to see covered?
>>> W.
>> If it's not covered by https://github.com/nb/wordpress-tests or
>> http://unit-tests.trac.wordpress.org/ , it should have a unit test in my
>> opinion.  None of the JS is currently unit tested.
>> http://aaron.jorb.in
>> twitter: twitter.com/aaronjorbin
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list