We need tests written, badly before we can continue to tweak major features.
Functional test
Log in admin user
Add a new view mode for nodes, enabled for articles but not pages.
Check new view mode is in entity_get_info
Check that articles have the settings from default copied over and overridden, and that pages fall back to default
Edit and rename the view mode, switching enabled from articles to pages
Check that articles now fall back to default, but pages have settings copied and overridden from default.
Delete the view mode.
Check that it is no longer in entity_get_info(), and that display settings cleaned up for both articles and page content types.
Template suggestion test
Go through each of the entity types in core, and 'render' them to assert what ends up in $variables['template_suggestions'] after entity_view_mode_preprocess() and that it is in the correct order.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 1900686-functional-tests.patch | 12.86 KB | dave reid |
| #6 | 1900686-functional-tests.patch | 7.41 KB | dave reid |
| #4 | 1900686-functional-tests.patch | 8.36 KB | dave reid |
| #2 | 1900686-functional-tests.patch | 6.7 KB | dave reid |
| #1 | 1900686-functional-tests.patch | 10.46 KB | dave reid |
Comments
Comment #1
dave reidInitial functional tests. Should prove that we have some failures in the current code.
Comment #2
dave reidTry that again...
Comment #4
dave reidExcellent. This fixes the bundle rename failures.
Comment #6
dave reidThis should resolve all the current failures. Discovered a new bug with setting $view_mode['is_new'].
Comment #8
dave reidSome day I'll get this right.
Comment #9
dave reidCommitted to 7.x-1.x! http://drupalcode.org/project/entity_view_mode.git/commit/1ecaff3
Now to work on the template suggestions part of the tests.
Comment #10
dave reidGoing to handle the rest of the tests with #1795812: Improve checking of entity type based on hook..