[wp-hackers] Unit Testing

Kunal Bhalla bhalla.kunal at gmail.com
Thu Jan 26 19:11:45 UTC 2012


Hi Wojtek

You might find parts of a plugin I had started useful for writing
tests -- this was intended to help write unit tests for Wordpress
plugins -- and can generate stub functions/classes for testing after
parsing wp-core/any folder you care to specify, which can then have
their behaviour specified using PressTest code
.(https://github.com/kunalb/PressTest/blob/master/mocked/core.php)

https://github.com/kunalb/PressTest . It itself has a few unit tests
that check PressTest itself, and I'd gotten started with
https://github.com/kunalb/EventPress/blob/reboot/ptests/includes/kb-at-Test.php
as well, for examples of usage.

Best,

Kunal



On Thu, Jan 26, 2012 at 11:02, 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.
>
>
> On Thu, Jan 26, 2012 at 7:40 PM, Jesper Jarlskov <jesper at jarlskov.dk> wrote:
>
>> Unit tests would be really awesome. Both for the standard unit test purpose
>> of providing more stable code that is less likely to break when changes are
>> made, but also to let WordPress stand out as a good example of how it
>> should be done :-)
>>
>> Jesper Jarlskov
>>
>>
>> On Thu, Jan 26, 2012 at 7:37 PM, William Satterwhite <
>> whsatterwhite at gmail.com> wrote:
>>
>> > Right there with you Mike.
>> >
>> > +1 for unit testing
>> >
>> > On Thu, Jan 26, 2012 at 1:36 PM, Mike Bijon <mike at etchsoftware.com>
>> wrote:
>> >
>> > > +1 for unit testing also
>> > > _______________________________________________
>> > > wp-hackers mailing list
>> > > wp-hackers at lists.automattic.com
>> > > http://lists.automattic.com/mailman/listinfo/wp-hackers
>> > >
>> >
>> >
>> >
>> > --
>> > William H. Satterwhite
>> > (252) 762-5177
>> > _______________________________________________
>> > wp-hackers mailing list
>> > wp-hackers at lists.automattic.com
>> > http://lists.automattic.com/mailman/listinfo/wp-hackers
>> >
>>
>>
>>
>> --
>> Jesper Jarlskov
>> _______________________________________________
>> 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