Problem/Motivation

When writing tests, if a module's schema is not correct, the test will fail. The correct resolution for this issue is to fix the module's schema file. However, the quick and easy fix is to set $strictConfigSchema = FALSE in the test class. This results in passing tests but allows broken schemas to exist.

Proposed resolution

Add a rule to the DrupalPractice standard to check for this variable being set to false and issues an error.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

jhedstrom created an issue. See original summary.

jhedstrom’s picture

Status: Active » Needs review
StatusFileSize
new6.77 KB

Here's just such a rule :)

jhedstrom’s picture

StatusFileSize
new4.25 KB

There's something wonky going on with the tarballed versions of this module (2.12 anyway), where test sources are not there, so the patch in #2 fails to apply. Here's the patch with just the sniff, so it applies cleanly to the 2.12 tarball.

The patch in #2 should still be the one to be reviewed, committed, etc.

drumm’s picture

klausi’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev
Status: Needs review » Needs work

Makes sense! Can you port this to Coder 8.x-3.x?

And please create a pull request against https://github.com/pfrenssen/coder so that we see the automated tests run :-)

jhedstrom’s picture

  • klausi committed 9c1ccd9 on 8.x-3.x authored by jhedstrom
    feat(StrictSchemaDisabled): Add sniff for $strictConfigSchema in tests...
klausi’s picture

Status: Needs work » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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