logo       

[feature] Regression/Unit/System Test Hook: msg#01024

php.drupal.devel

Subject: [feature] Regression/Unit/System Test Hook

Project: Drupal
Version: cvs
Component: base system
Category: feature requests
Priority: normal
Assigned to: Anonymous
Reported by: javanaut
Updated by: weitzman@xxxxxxxxxxxx
Status: active
Attachment: http://drupal.org/files/issues/drupal_0 (5.3 KB)

I've uploaded a 'simpletest' module to Contrib which provides a unit
testing framework for drupal. Please give it a try and provide
feedback. Especially try to write a test and see if the framework is
useful. Here is the README:

Description
------------------
A framework for running unit tests in Drupal.

Status
------------------
One test has been written - 'user validation'. We need more.

Requirements
----------------

- Install the simpletest framework to a new directory called
'simpletest' right under Drupal root.
You can find it at http://www.lastcraft.com/simple_test.php

Install
-----------------------

- Copy this module package to your /modules directory
- Activate the simpletest.module
- Visit the admin/simpletest page

Simpletest hook
-----------------------

This module offers a new 'simpletest' hook. Modules implementing this
hook should an array of paths which
point to test files. These paths should be relative to the /simpletest
directory.

Writing Tests
-----------------------
Please write some tests. I'm a bit new at this and haven't decided on a
worthy approach.

Author
---------------------




--------------------------------------------------------------------------------

Description
------------------
A framework for running unit tests in Drupal.

Status
------------------
No tests have been written. This framework should work though.
Requirements
----------------

- Install the simpletest framework to a new directory called
'simpletest' right under Drupal root.
You can find it at http://www.lastcraft.com/simple_test.php

Install
-----------------------

- Copy this module package to your /modules directory
- Activate the simpletest.module
- Visit the admin/simpletest page

Simpletest hook
-----------------------

This module offers a new 'simpletest' hook. Modules implementing this
hook should an array of paths which
point to test files. These paths should be relative to the /simpletest
directory.

Writing Tests
-----------------------
Please write some tests. I'm a bit new at this and haven't decided on a
worthy approach.



weitzman@xxxxxxxxxxxx



Previous comments:
------------------------------------------------------------------------

February 25, 2004 - 14:14 : javanaut

A hook would be defined by each module/theme to execute a suite of tests
on itself.

These tests could all be invoked on an administration page. Inter-module dependencies could be tested, new modifications could be
tested...generally, anything that a module developer wants to test
could be included. This would, IMO, make the community development
process flow better as each developer could make sure his/her code
doesn't break others' or in the presence of others'. It would allow
you to instantly know when you have broken some major functionality of
a given set of modules (or somebody else has broken yours).

I'm not interested in engaging in the battle over extreme programming
or anything like that, just a means of testing module/theme
functionality without having to click all over the place to do it. I
would be content with the hook merely returning success or failure, but
a testing framework may be useful for more detailed testing.

More information about test-driven development can be found at
phpPatterns [1] or at junit.org [2].


[1] http://www.phppatterns.com/index.php/article/articleview/33/1/2/
[2] http://junit.org/index.htm


------------------------------------------------------------------------

February 26, 2004 - 21:56 : weitzman@xxxxxxxxxxxx

This is a very smart proposal. I hope someone moves this forward. more
relevant links:

- simpletest framework [3]
- php unit testing intro [4]
[3] http://www.lastcraft.com/simple_test.php
[4] http://www.lastcraft.com/first_test_tutorial.php


--
View: http://drupal.org/node/view/6055
Edit: http://drupal.org/project/comments/add/6055





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise