Problem/Motivation

While working on #3232190: CKEditor 5 readiness, I could've recreated most of what \Drupal\Tests\ckeditor5\Kernel\ValidatorsTest already gives me…

… so I chose not to.

But there's a single thing that gets in the way: \Drupal\Tests\SchemaCheckTestTrait::assertConfigSchema() is called early on by \Drupal\Tests\ckeditor5\Kernel\ValidatorsTest::test(), which is resulting in test failures like:

There should be no errors in configuration 'editor.editor.dummy'. Errors:
Schema key editor.editor.dummy:settings.plugins.linkit_extension.linkit_enabled failed with: variable type is string but applied schema class is Drupal\Core\TypedData\Plugin\DataType\BooleanData

Failed asserting that Array &0 (
    'editor.editor.dummy:settings.plugins.linkit_extension.linkit_enabled' => 'variable type is string but applied schema class is Drupal\Core\TypedData\Plugin\DataType\BooleanData'
) is true.

… even though that is A) literally the intention of the test case, B) this kind of error does not occur while using typed config validation in real life: it's an extra check that \Drupal\Tests\SchemaCheckTestTrait::assertConfigSchema() layers on!

Basically, \Drupal\Core\Config\Schema\SchemaCheckTrait::checkValue() largely duplicates \Drupal\Core\Validation\Plugin\Validation\Constraint\PrimitiveTypeConstraintValidator … because no config in Drupal core actually uses config validation 🙃

Since CKEditor 5 actually does use it, we don't need this extra check. Or at least not when we want to assert config schema validation violations — running it only when there's no validation errors otherwise would make sense.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork ckeditor5-3245807

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Wim Leers created an issue. See original summary.

wim leers’s picture

Assigned: wim leers » Unassigned
Status: Active » Needs review

Wim Leers credited lauriii.

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Walked @lauriii through this on a call, he says it totally makes sense 🚢

  • Wim Leers committed 2443628 on 1.0.x
    Issue #3245807 by Wim Leers, lauriii: DX: allow contrib modules to...
wim leers’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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