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
Loading
Loading
Loading
Loading
+6 −6
Changes for core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -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];
+1 −0
Changes for core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -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
   */
+0 −1
Changes for core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -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',