This module does quite a lot, it turns out. It'd be great if there were tests to figure out if everything is working properly.

I'll try and document test cases as I find them here. Reviewing this module as part of #2325607: [meta] Get DMU working on Diff module.

Diff compare widgets

Revisions list w/ Diff

  • testRevisionsList — go to node/%node/revisions/list and verify diff output is on page.

Diff comparison

Revisions comparison w/ Diff

  • testRevisionsCompare — go to node/%node/revisions/view and verify diff comparison between 2 disparate revisions shows up.
  • testRevisionsLatest — go to node/%node/revisions/view/latest and verify that diff comparison against latest revision is shown

Diff admin settings

Diff admin menu item
Diff main settings form

  • testDiffSettings — go to admin/config/content/diff and verify that main settings form is working properly.

Diff entity settings form

  • testDiffSettingsNodeEntity — go to admin/config/content/diff/entities/node and verify settings form is working properly.
  • testDiffSettingsUserEntity — (not pictured) go to admin/config/content/diff/entities/user and verify settings form is working properly.

Diff Fields overview form
Diff Field settings form

Inline differences block

'Inline Differences' block in block listing
Block config page
Differences showing inline

  • testDiffBlock — Make sure block shows up in block listing at admin/structure/block, verify it shows up on content types selected.
  • testInlineDiff — (??? — not sure if this can be tested w/ SimpleTest). Test that changes are correctly highlighted when selecting revisions from block.

Diff buttons

View changes button
Diff shown at top of node form

  • testViewChanges — verify that "View changes" button shows up on node edit form, shows diff at top when clicked.

Node type form settings

Compare revisions vertical tab on node type form

  • testDiffSettingsNodeType — verify that Compare revisions options are working on e.g. Page.

Diff entity display

Entity display mode

  • testDiffDisplayMode — Go to admin/structure/types/manage/page/display, expand "Custom display settings, verify "revision comparison" shows up as a selectable view mode.

If someone feels exceptionally spunky

  • testLimitedItems — verify that REVISION_LIST_SIZE is working properly.
  • testExposedSorting — verify that diff sorting is working properly: DIFF_SORT_NONE, DIFF_SORT_VALUE, DIFF_SORT_CUSTOM.
  • testHelpText — test that help text is exposed where it should be (admin/help/diff, node/%/revisions/%/view, node/%/revisions/view/%/%
  • testDiffStates — test diff states (raw (Standard) / raw_plain (Marked down)
  • testRevisionAdminTheme — tests that revisions pages are shown in admin theme
  • testContentTypeRename — tests that when you rename a content type, all settings are remembered.
  • testContentTypeDelete — tests that when you delete a content type, all settings are deleted.
  • testDiffUsers — tests that diff features also work on users.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

webchick’s picture

Issue summary: View changes

Formatting.

webchick’s picture

webchick’s picture

Issue summary: View changes
FileSize
53.44 KB
webchick’s picture

Issue summary: View changes
Alan D.’s picture

I actually wonder if "Inline differences block" is worth removing and creating a separate project for? Open to peoples opinions on this. It is one thing that I have never used, and it is one thing that is a bit problematic in terms of integration with other modules.

I am just stating this here so either to drop (maybe unrequired) or raise the priority (it is the bit that normally fails) depending on the answer :)

@webchick
Thanks for your mentoring here. I was letting the core structural changes to get done before starting to review things hard.

webchick’s picture

Oh, I think that's a totally fair feature to drop, from a module POV. *I* personally like it being there because then we get Drupal Module Upgrader working for configurable blocks and JS/CSS. ;)

Alan D.’s picture

lol, lets keep it for the meantime then, but with the possible intent to either separate out into a sub-module or even another project latter.

webchick’s picture

Status: Active » Needs review
FileSize
4.41 KB

Here is the absolute most basic start. All it does is define a base class that does some of the boilerplate work (like creating a node with 3 revisions for each test), then defines a test method that:

1) Hits node/X/revisions and makes the Compare button exists
2) Submits the form with the Compare button to make sure there are no errors
3) Validates that the output on the diff comparison is what's expected
4) While we're in there any way, tests the next/previous difference links as well

This should hopefully give kind of an idea of what's needed here. I'm not sure how much further (if at all) I'll be able to take this, so uploading what I've got after an hour or two of copy/pasting a lot from modules/node/node.test. :)

miro_dietiker’s picture

I just committed basic test coverage for 8.x in the current master port sandbox.

No configuration variation yet, but the default processes offered with default settings.
See #2422735: Provide basic test coverage