Simpletesting Drupal and a Simpletest Snippet

There is no question that test driven development is coming to Drupal. And it may be sooner than anyone expected.

Last week at Drupalcon 2008 Dries challenged the community: Provide 100% test coverage for Drupal core by mid may, and the code freeze can be pushed off until November.

So to help you get started in your testing - I've attached a Komodo snippet that will help create a .test file stub.

Don't know what to do with that? Want to start writing your own tests for your own modules? Great! - Check out these great resources.

andre

Introduction to unit testing
Simpletest documentation
Drupal Simpletest Module
Module Developers Guide to Simpletest
Drupal Conference Presentations (ctrl+f for simpletest)

AttachmentSize
drupal_simpletest_testfile_stub.kpz1.85 KB
March 10th 2008 9AM
By: andre
File Under:

 

Comments

Heck yeah

This is a good idea. Spreading the testing love far and wide will mean good documentation and snippets for various IDEs. Thanks for pushing the ball forward!

Awesome stuff, Andre

I like the snippet to start the .test files ... have you looked into integrating simpletest with the new unit testing features of 4.3?

I looked at phpUnit...

I looked at phpUnit in the context of Komodo - but my first quick attempt at a test didn't work out so well. I'm sure it works fine, but I didn't dig too deep to make it happen.

I'm not sure it is possible to tell Komodo to use a different test suite. If it is, I haven't found it yet. If anyone knows how this might be done, I'd love to see simpletest output right inside Komodo.

andre

komodo 4.4, currently in

komodo 4.4, currently in (quite stable) beta [1], allows the the integration of any unittesting framework [2] - so simpletest integration shouldn't be too hard anymore. would be nice to see something here :)

[1] http://downloads.activestate.com/Komodo/releases/
[2] http://community.activestate.com/writing-unittest-harnesses-komodo-4-4-i...