In order to give at least the appearance of test-driven development, we should port the existing form_example D7 SimpleTest tests to D8.
These tests should be ported as directly as possible, without changing them.
Note that these tests will fail. :-) The point of this exercise is to write tests that fail.
This issue will be marked fixed when they run without fatal code errors.
In order to build the tests, you will also need to generate the file structure of the module.
One thing to keep in mind is that SimpleTest shows you a stack trace for fails, as if they were errors. This is the most annoying part of porting tests; they look like they're broken when they're really not.
Steps to take:
- Assign the issue to yourself.
- Generate a module skeleton.
- Convert tests.
- Run tests.
- More conversion if necessary.
- Submit a patch.
Resources:
A tool to generate a module skeleton: https://drupal.org/sandbox/mile23/2230027
Test conversion notes: https://drupal.org/node/2166895
How to run tests:
- In Drupal: https://drupal.org/documentation/modules/simpletest
- From the command line: https://drupal.org/node/645286
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | port_d7_tests_to_d8_for-2277631-1.patch | 10.64 KB | cilefen |
Comments
Comment #1
cilefen commentedComment #3
zealfire commentedComment #4
mile23Generally unassigning issues. Please re-assign yourself as desired.
Comment #5
mile23form_example supports the tutorial at http://drupal.org/node/262422
The tutorial is for Drupal 7.
We currently have the form_api_example which is where work should continue.
Thanks, @cilefen. :-)