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)
I've been playing around with Komodo a bit lately, and have been intrigued by the tools available to customize the development environment.
One of the more powerful features in Komodo is the ability to create 'snippets', 'commands' and 'macros'. They say that whatever can be automated should be automated when developing code. The less monkey work you do the better, and snippets, commands and macros are a great way to reduce said monkey work.
As an experiment I created a macro that will create a module stub. When run, the macro asks you to name your module. It then creates the module folder, the three primary module files and a 'test' directory.
Limitations:
Possible Improvements:
Last night I wrote about how Komodo 4.3 Beta Includes Drupal Specific Snippets.
Today I show you how you can create your own Snippets so that you can spend less time doing repetitive Drupal development tasks and more time writing the juicy parts of your modules.
In this video tutorial, I create a snippet for hook_link_alter.
The basics steps are:
I recently made the switch from Zend Studio to Komodo as my IDE (Integrated Development Environment).
Now the reason for the switch wasn't because Active state, makers of Komodo, have a community site built on Drupal. But, it is nice to see that their developers and I have something in common.
While browsing the community site I stumbled upon a this forum thread discussing Drupal as the engine behind the community site. After I joined that conversation JeffG pointed out that Komodo 4.3 Beta actually has a couple of "snippets" in the default Komodo "toolbox" that are Drupal specific.
From the Komodo Help file:
Snippets are frequently used strings that can be quickly inserted into the current document. For example, repetitive sections of code or standard comments can be stored within a snippet. Snippets have advanced properties; they support the use of Tab Stops and Interpolation Shortcuts, can be assigned to Key Bindings, and allow for the specification of indentation context and cursor position.