Index: trunk/phase3/maintenance/tests/phpunit/TODO |
— | — | @@ -1,5 +1,9 @@ |
2 | 2 | == Things To Do == |
3 | 3 | |
| 4 | +* DEFAULT TESTS NEED TO MADE NON-DESTRUCTIVE. Any destructive tests which alter the contents of the live wiki need to |
| 5 | +be protected with an explicit confirmation so people exploring their system don't accidentally destroy their main page |
| 6 | +or register user accounts with default passwords. |
| 7 | + |
4 | 8 | * Most of the tests are named poorly; naming should describe a use case in story-like language, not simply identify the |
5 | 9 | unit under test. An example would be the difference between testCalculate and testAddingIntegersTogetherWorks. |
6 | 10 | * Many of the tests make multiple assertions, and are thus not unitary tests. By using data-providers and more use-case |
Index: trunk/phase3/maintenance/tests/phpunit/Makefile |
— | — | @@ -1,12 +1,24 @@ |
2 | | -.PHONY: help test phpunit install coverage |
| 2 | +.PHONY: help test phpunit install coverage warning destructive |
3 | 3 | |
4 | 4 | SHELL = /bin/sh |
5 | 5 | CONFIG_FILE = $(shell pwd)/suite.xml |
6 | 6 | FLAGS = |
7 | 7 | PU = phpunit --configuration ${CONFIG_FILE} |
8 | 8 | |
9 | | -all test: phpunit |
| 9 | +all test: warning |
10 | 10 | |
| 11 | +warning: |
| 12 | + @echo "WARNING -- these tests are DESTRUCTIVE and will alter your wiki." |
| 13 | + @echo "DO NOT RUN THESE TESTS on a production wiki." |
| 14 | + @echo "" |
| 15 | + @echo "Until the default suites are made non-destructive, you can run" |
| 16 | + @echo "the destructive tests like so:" |
| 17 | + @echo "" |
| 18 | + @echo " make destructive" |
| 19 | + @echo "" |
| 20 | + |
| 21 | +destructive: phpunit |
| 22 | + |
11 | 23 | phpunit: |
12 | 24 | ${PU} |
13 | 25 | |
Index: trunk/phase3/maintenance/tests/phpunit/README |
— | — | @@ -3,6 +3,12 @@ |
4 | 4 | Some quickie unit tests done with the PHPUnit testing framework. To run the |
5 | 5 | test suite, run 'make test' in this (maintenance/tests/phpunit) directory. |
6 | 6 | |
| 7 | +=== WARNING === |
| 8 | + |
| 9 | +The current versions of some of these tests are DESTRUCTIVE AND WILL ALTER |
| 10 | +YOUR WIKI'S CONTENTS. DO NOT RUN ON A PRODUCTION SYSTEM OR ONE WHERE YOU |
| 11 | +NEED TO RETAIN YOUR DATA. |
| 12 | + |
7 | 13 | === Installation === |
8 | 14 | |
9 | 15 | PHPUnit is no longer maintained by PEAR. To get the current version of |