Problem/Motivation
For #3482684: Use Drupal Conditions Plugin API to include / exclude by certain conditions we should also add some tests and test the settings form in general.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork tab_title_attention-3482770
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 #2
anybodyShould be a quick thing, when using a good template to start. ETA: 30min
We won't test the animation itself, of course.
Comment #3
lrwebks commentedComment #5
lrwebks commentedChanges to the tests as well as new tests done, however phpunit does not seem to be overly happy about the schema for the conditions.
I see two options here:
1. Define the schema differently (I am not that familiar with the dynamic schema for conditions though)
2. Use the actual settings page to change the settings in the tests (Not a friend of that since it should also work when changed via configFactory)
Any suggestions on how to proceed?
Comment #6
anybodyOur current implementation is very similar to what block.schema.yml implements:
Here's an example from
/core/modules/block_content/tests/modules/block_content_test/config/install/block.block.foobar_gorilla.yml:So I can't see major differences and think the mistake might not be on our side, but on the side of the condition plugin that causes this issue?
Wondering why it doesn't fail in core block tests then? Any ideas?
Comment #7
anybodyI compared everything to
web/core/modules/system/tests/modules/condition_test/and it looks fine, so I think this is test-specific.Looking at the condition tests, I saw they were using the "system" module! Perhaps that's what we need.
If it's not enough, we could check if
condition_testtest module dependency is required, but I don't think so.Comment #8
anybodyYeah it's definitely from the "system" module and it defines the schema correctly:
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/syste...
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/config/schema...
negate etc. are inherited!
It totally makes sense to require the "system" module though, as it's where request_path Condition Plugin is implemented:
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/syste...
But no more idea, why it still doesn't fix the failing tests.
Comment #9
anybodyOkay I'm going to merge the tests now, as they work as expected. No more idea what's causing the schema to fail, but let's solve this one day...
Comment #11
anybodyBack to NW for the schema issue.
Comment #12
anybodyComment #13
anybodyOkay sadly lots of time wasted. If we just had a look at the line, where the Schema error is reported, we'd have seen that this is NOT a schema error, but a bug in the tests implementation...
On it!
Comment #15
anybodyOkay all green now. I believe the other tests fail because of #2783897: Current theme condition plugin should provide an option to match all themes and introduce checkboxes
Follow-Up: https://www.drupal.org/project/tab_title_attention/issues/3485667