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
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
Comment #3
wim leersComment #5
wim leersWalked @lauriii through this on a call, he says it
🚢Comment #7
wim leers