I created a GHOP proposal to lay grounds for a simpletest suite of CCK field storage in http://drupal.org/node/209391.
This Wiki page aims at defining the actual list of tests that would constitute an exhaustive suite when we have an overall structure. The actual scope of the proposed GHOP task is not to implement all these tests, but to provide the overall structure and reusable code (note the 'Repeat the above' items), and actually code, say, the first two 'dark bullets' items below.
Whether the task gets picked by a GHOP student or not, this gives us something to refine and think about.
content types : type1, type2, type3
nodes : node1 (type1), node2 (type2), node3 (type3)
Each 'dark bullet' item below starts with a fresh state of types and nodes.
After each step, 3 tests have to be done :
a) Check that drupal_get_schema is the expected database schema according to CCK's logic for db layout (per field / per type tables).
b) Check that the actual db structure matches drupal_get_schema.
c) Check that a node_load returns the expected field data.
Basic tests : creation, multiplicity, sharing, deletion
-
Check single->multiple + sharing multiple
field1 : text field, plain text, single- add field1 to type1, fill in a value for node1
- change field1 to multiple
- fill in values for node1
- add field1 to type2, fill in values for node2
- add field1 to type3, fill in values for node3
- remove field1 from type3
- remove field1 from type2
- remove field1 from type1
-
Check multiple->single + sharing single
field1 : text field, plain text, multiple- add field1 to type1, fill in values for node1
- change field1 to single
- fill in values for node1
- add field1 to type2, fill in a value for node2
- add field1 to type3, fill in a value for node3
- remove field1 from type3
- remove field1 from type2
- remove field1 from type1
-
Repeat the above using 'formatted' text fields (uses 2 storage columns)
Check altering both multiplicity and columns set
-
field1 : text field, plain text, single
- add field1 to type1, fill in a value for node1
- change field1 to formatted, multiple
- fill in values for node1
-
field1 : text field, plain text, multiple
- add field1 to type1, fill in values for node1
- change field1 to formatted, single
- fill in value for node1
-
field1 : text field, formatted, single
- add field1 to type1, fill in a value for node1
- change field1 to plain text, multiple
- fill in values for node1
-
field1 : text field, formatted, multiple
- add field1 to type1, fill in values for node1
- change field1 to plain text, single
- fill in value for node1
Check altering both shared status and columns set
(...)
Check altering both shared status and multiplicity
(...)