Revert "Issue #2995992 by jcandan, dww, edsoncarlos: Country field should...
Revert "Issue #2995992 by jcandan, dww, edsoncarlos: Country field should display the "- Select -" option to match core behavior"
This reverts commit 502ee52c.
// Country should be required and set to empty value option.
$this->field->setDefaultValue([]);
$this->field->setRequired(TRUE);
$this->field->save();
$this->drupalGet($this->nodeAddUrl);
$this->assertNotEmpty((bool)$this->xpath('//select[@name="'.$field_name.'[0][address][country_code]" and boolean(@required)]'),'Country is shown as required.');
$this->assertOptionSelected($field_name.'[0][address][country_code]','','The empty option is selected.');
$this->assertNotEmpty($element->isSelected(),$message?$message:newFormattableMarkup('Option @option for field @id is selected.',['@option'=>$option,'@id'=>$id]));
}
}
/**
* Asserts that the passed field values are correct.
*
* Ignores differences in ordering.
*
* @param array $field_values
* The field values.
* @param array $expected_values
* The expected values.
* @param string $message
* (optional) A message to display with the assertion. Do not translate
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
* variables in the message text, not t(). If left blank, a default message