Problem/Motivation

Some basic functionality is missing test coverage.

Proposed resolution

Create tests for

  • unsubscribing aka disabling
  • tokens
  • user preferences
  • user/node/comment deletion
  • mail body
  • extra field display
  • settings form

I don't think we want to create all these tests at once, it's more helpful to commit them in parts. I think unsubscribing, tokens and user preferences are top priority, because they are basic non-admin features, and the rest can be done in separate issues?

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Arla created an issue. See original summary.

gnuget’s picture

Status: Active » Needs review

I've been using this module for a few days now and I already found a few issues on it (see [#2853329 and #2850935: Error when the user has been created and edit his profile for first time) I already provided a patch for those but I would like to help stabilizing this module.

For start moving this I just attached a patch with the following changes:

  • migrate the test from WTB to BTB
  • fix all the Drupal coding standards issues.
  • fix all the Drupal coding standards issues.
  • replace all the deprecated methods
  • Added a base class so we can separate the tests in several files

I will continue working on this, and like the description mentioned, Would be great to start commiting this and create separate issues for the rest of the tests, so I can work on the tests of (see [#2853329 and #2850935: Error when the user has been created and edit his profile for first time) directly in these issues.

gnuget’s picture

Status: Needs review » Needs work

The last submitted patch, 3: 2618192-basic-coverage-3.patch, failed testing.

gnuget’s picture

Status: Needs work » Needs review
FileSize
396 bytes
17.36 KB

It seems to the group is required, lets try again

Status: Needs review » Needs work

The last submitted patch, 5: 2618192-basic-coverage-5.patch, failed testing.

gnuget’s picture

ok, lets try again.

gnuget’s picture

It seems to I forgot to add the group annotation in the base class.

Let's see if I can make happy the testbot this time.

greggles’s picture

@gnuget thanks for your work on improving test coverage. I wonder if you can comment on #2851055: Update documentation about anonymous email field?

gnuget’s picture

Sure thing!

gnuget’s picture

New patch, this one includes tests for the settings form.

Arla’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. Having the test converted and extended for the settings form is a great start. As said in IS, we could commit this and either keep the issue open or close it and create followups for each area to extend tests for. Thus I'm marking RTBC.

Just noting that 1) a prettier diff could be made with git diff -M2 and 2) the commentExists() helper is not used (and was not used before this patch either) (I don't really mind it hanging around anyway).

DamienMcKenna’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
24.8 KB
405 bytes

One small thing - the abstract class shouldn't have a @group.

DamienMcKenna’s picture

gnuget’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

DamienMcKenna’s picture

It might be worthwhile to use e.g. Maillog with the tests to make it easier to see what emails are being generated.

  • greggles committed 6210532 on 8.x-1.x authored by gnuget
    Issue #2618192 by gnuget, DamienMcKenna, Arla: Increase basic test...
greggles’s picture

Status: Reviewed & tested by the community » Fixed

This seems like an important thing to get merged to help with other work on the module. Thanks so much for your help!

I marked this issue as fixed and created a followup at #3020400: Basic test coverage round 2.

Status: Fixed » Closed (fixed)

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