Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix tests for Drupal 11.0 since changes on field creation UI
Browse files Browse the repository at this point in the history
WengerK committed May 31, 2024

Verified

This commit was signed with the committer’s verified signature.
WengerK Kevin Wenger
1 parent aa18481 commit f557751
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
7 changes: 6 additions & 1 deletion tests/src/Functional/UiFieldTest.php
Original file line number Diff line number Diff line change
@@ -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.0', '<')) {
$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');
}

0 comments on commit f557751

Please sign in to comment.