Skip to content
Snippets Groups Projects
Unverified Commit 803a34ba authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3139422 by sja112, jungle, akanksha-hp, mondrake, xjm: Replace usages...

Issue #3139422 by sja112, jungle, akanksha-hp, mondrake, xjm: Replace usages of deprecated AssertLegacyTrait::assertOptionByText()
parent a8a6638e
No related branches found
No related tags found
8 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1012Issue #3226887: Hreflang on non-canonical content pages,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10,!596Issue #3046532: deleting an entity reference field, used in a contextual view, makes the whole site unrecoverable,!496Issue #2463967: Use .user.ini file for PHP settings,!144Issue #2666286: Clean up menu_ui to conform to Drupal coding standards,!16Draft: Resolve #2081585 "History storage",!13Resolve #2903456
......@@ -460,23 +460,23 @@ public function testDatelistWidget() {
$this->assertFieldByXPath("//*[@id=\"edit-$field_name-0-value-year\"]", NULL, 'Year element found.');
$this->assertOptionSelected("edit-$field_name-0-value-year", '', 'No year selected.');
$this->assertOptionByText("edit-$field_name-0-value-year", t('Year'));
$this->assertSession()->optionExists("edit-$field_name-0-value-year", t('Year'));
$this->assertFieldByXPath("//*[@id=\"edit-$field_name-0-value-month\"]", NULL, 'Month element found.');
$this->assertOptionSelected("edit-$field_name-0-value-month", '', 'No month selected.');
$this->assertOptionByText("edit-$field_name-0-value-month", t('Month'));
$this->assertSession()->optionExists("edit-$field_name-0-value-month", t('Month'));
$this->assertFieldByXPath("//*[@id=\"edit-$field_name-0-value-day\"]", NULL, 'Day element found.');
$this->assertOptionSelected("edit-$field_name-0-value-day", '', 'No day selected.');
$this->assertOptionByText("edit-$field_name-0-value-day", t('Day'));
$this->assertSession()->optionExists("edit-$field_name-0-value-day", t('Day'));
$this->assertFieldByXPath("//*[@id=\"edit-$field_name-0-value-hour\"]", NULL, 'Hour element found.');
$this->assertOptionSelected("edit-$field_name-0-value-hour", '', 'No hour selected.');
$this->assertOptionByText("edit-$field_name-0-value-hour", t('Hour'));
$this->assertSession()->optionExists("edit-$field_name-0-value-hour", t('Hour'));
$this->assertFieldByXPath("//*[@id=\"edit-$field_name-0-value-minute\"]", NULL, 'Minute element found.');
$this->assertOptionSelected("edit-$field_name-0-value-minute", '', 'No minute selected.');
$this->assertOptionByText("edit-$field_name-0-value-minute", t('Minute'));
$this->assertSession()->optionExists("edit-$field_name-0-value-minute", t('Minute'));
$this->assertNoFieldByXPath("//*[@id=\"edit-$field_name-0-value-second\"]", NULL, 'Second element not found.');
$this->assertFieldByXPath("//*[@id=\"edit-$field_name-0-value-ampm\"]", NULL, 'AMPM element found.');
$this->assertOptionSelected("edit-$field_name-0-value-ampm", '', 'No ampm selected.');
$this->assertOptionByText("edit-$field_name-0-value-ampm", t('AM/PM'));
$this->assertSession()->optionExists("edit-$field_name-0-value-ampm", t('AM/PM'));
// Submit a valid date and ensure it is accepted.
$date_value = ['year' => 2012, 'month' => 12, 'day' => 31, 'hour' => 5, 'minute' => 15];
......
......@@ -484,6 +484,7 @@ public function testFieldAssertsForTextfields() {
* Tests legacy field asserts for options field type.
*
* @group legacy
* @expectedDeprecation AssertLegacyTrait::assertOptionByText() is deprecated in drupal:8.4.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionExists() instead. See https://www.drupal.org/node/3129738
* @expectedDeprecation AssertLegacyTrait::assertOption() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionExists() instead. See https://www.drupal.org/node/3129738
* @expectedDeprecation AssertLegacyTrait::assertNoOption() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionNotExists() instead. See https://www.drupal.org/node/3129738
*/
......
......@@ -191,7 +191,6 @@ public static function getSkippedDeprecations() {
'AssertLegacyTrait::assertNoLinkByHref() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->linkByHrefNotExists() instead. See https://www.drupal.org/node/3129738',
'AssertLegacyTrait::assertNoFieldById() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldNotExists() or $this->assertSession()->buttonNotExists() or $this->assertSession()->fieldValueNotEquals() instead. See https://www.drupal.org/node/3129738',
'AssertLegacyTrait::assertUrl() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->addressEquals() instead. See https://www.drupal.org/node/3129738',
'AssertLegacyTrait::assertOptionByText() is deprecated in drupal:8.4.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionExists() instead. See https://www.drupal.org/node/3129738',
'AssertLegacyTrait::assertOptionSelected() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionExists() instead and check the "selected" attribute. See https://www.drupal.org/node/3129738',
'AssertLegacyTrait::assertFieldChecked() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->checkboxChecked() instead. See https://www.drupal.org/node/3129738',
'AssertLegacyTrait::assertNoFieldChecked() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->checkboxNotChecked() instead. See https://www.drupal.org/node/3129738',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment