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.

Comments

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new10.46 KB

Initial functional tests. Should prove that we have some failures in the current code.

dave reid’s picture

StatusFileSize
new6.7 KB

Try that again...

Status: Needs review » Needs work

The last submitted patch, 1900686-functional-tests.patch, failed testing.

dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new8.36 KB

Excellent. This fixes the bundle rename failures.

Status: Needs review » Needs work

The last submitted patch, 1900686-functional-tests.patch, failed testing.

dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new7.41 KB

This should resolve all the current failures. Discovered a new bug with setting $view_mode['is_new'].

Status: Needs review » Needs work

The last submitted patch, 1900686-functional-tests.patch, failed testing.

dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new12.86 KB

Some day I'll get this right.

dave reid’s picture

Status: Needs review » Active

Committed 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.

dave reid’s picture

Status: Active » Fixed

Going to handle the rest of the tests with #1795812: Improve checking of entity type based on hook..

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.