diff --git a/CHANGELOG.md b/CHANGELOG.md index f86a196..b6ff377 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - fix tests for Drupal 10.3 since changes on field creation experience - fix tests for Drupal 10.3 since changes on taxonomy form supporting vertical tabs - fix deprecation by passing @dataprovider as static function +- fix tests for Drupal 11.0 since changes on field creation UI ## [4.0.1] - 2024-03-01 ### Changed diff --git a/tests/src/Functional/UiFieldTest.php b/tests/src/Functional/UiFieldTest.php index 3c3fcda..70f28c2 100644 --- a/tests/src/Functional/UiFieldTest.php +++ b/tests/src/Functional/UiFieldTest.php @@ -108,10 +108,15 @@ public function testAddField() { // Add the Template Whisperer field. // Since Drupal 10.2 the field type has been changed from select to radio. - if (version_compare(\Drupal::VERSION, '10.2', '>=')) { + if (version_compare(\Drupal::VERSION, '10.2', '>=') && version_compare(\Drupal::VERSION, '11', '<')) { $this->assertSession()->elementExists('css', "[name='new_storage_type'][value='template_whisperer']"); $this->getSession()->getPage()->selectFieldOption('new_storage_type', 'template_whisperer'); } + // Since Drupal 11.0 the field type has been changed from radio to select. + elseif (version_compare(\Drupal::VERSION, '11.0', '>=')) { + $this->assertSession()->elementExists('css', "[name='new_storage_type'] option[value='template_whisperer']"); + $this->getSession()->getPage()->selectFieldOption('new_storage_type', 'template_whisperer'); + } else { $this->fillField('Add a new field', 'template_whisperer'); }