Create assertIsApplicable() and assertIsNotApplicable() in widget base class

Created on 30 January 2020, almost 5 years ago
Updated 24 June 2024, 7 months ago

This is a follow-on from #3109923: Deprecation: add $defaultTheme - create FormWidgetBrowserTestBase class β†’ which adds a new FormWidgetBrowserTestBase class.

In that base class we can define protected functions assertIsApplicable($widget, $type) and assertIsNotApplicable($widget, $type) to simplify the testIsApplicable function then the subclasses don't need to deal with DataDefinition at all.

Instead of the subclasses having to do $this->assertFalse($this->widget->isApplicable(DataDefinition::create('boolean'))); etc, this will now be in the helper function, and the subclasses just substitute $this->assertIsApplicable($this->widget, 'boolean'); etc.

Credit to TR for this idea

πŸ“Œ Task
Status

Active

Version

2.1

Component

Miscellaneous

Created by

πŸ‡¬πŸ‡§United Kingdom jonathan1055

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024