A simpletest unit test stub generator

lego1974@drupal.org - March 12, 2008 - 14:11
Project:SimpleTest
Version:5.x-1.0
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hello, I've written a perl script (fastens fire-proof suit) that generates module files as well as a test file complete with a test class and stubbed methods. I wasn't really sure where to go about posting it, and webchick suggested I start here. So, here I start. From the documentation:

# Features:
# - creates a module folder and associated file skeletons
# - generates a test class and test methods and places them in a test file
# recognized by SimpleTest. This currently only covers unit tests,
# and not higher level tests like functional or integration tests.
# - can be re-run throughout module development
# - if you add a new function to a module, rerun the script and a test
# stub will be generated and placed in the appropriate test class
# - works with existing modules
# - adds hook_simpletest to an existing module
#
# Issues:
# - test stubs intentionally fail. I tried replicating PHPUnit's
# TestNotImplementedException, but I didn't find a similar facility
#
# Assumptions:
# - the drupal coding standard is followed (generally, 1 tab == 2 spaces)
# - a single module is defined per directory
# - the module has the same name as the directory
#
# Features Not Included:
# - getters and setters for classes defined in module file
# - class handling in general is not working, but the basic code is in place
#
# TODO:
# - complete handling for classes
# - add handling for function removal by developer
# - make template variables files - is this necessary?
# - create CRUD scaffolds a la Ruby on Rails
# - improve test coverage to include suites and further automation
#

Anyway, I hope you find this useful. I'm using it internally at my company.

-Andy

AttachmentSize
Modulator.pl_.txt20.04 KB

#1

lego1974 - March 12, 2008 - 14:18

I'm an idiot. this should be for user lego1974, not lego1974@drupal.org

#2

sirkitree - April 16, 2008 - 15:46

I love this. I don't use it too much for simpletest purposes, but generating a module quickly, i find it faster then module_builder... you should post this in the module_build queue as well

#3

boombatower - May 15, 2008 - 00:45
Status:active» closed

1) I don't think this belongs here.
2) It isn't an issue so doesn't make sense to leave it open.

 
 

Drupal is a registered trademark of Dries Buytaert.