Commit 71813a85 authored by catch's avatar catch
Browse files

Issue #3139407 by pavnish, mohrerao, mondrake, shaktik, rahulrasgon, durgeshs,...

Issue #3139407 by pavnish, mohrerao, mondrake, shaktik, rahulrasgon, durgeshs, shetpooja04, paulocs, ravi.shankar, ankithashetty, anmolgoyal74, munish.kumar, jungle, longwave, daffie: Replace usages of AssertLegacyTrait::assert(No)FieldById, that is deprecated
parent 95132eec
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ public function testViewsBlockForm() {
    $this->assertTrue(empty($elements), 'The label field is not found for Views blocks.');
    // Test that the machine name field is hidden from display and has been
    // saved as expected from the default value.
    $this->assertNoFieldById('edit-machine-name', 'views_block__test_view_block_1', 'The machine name is hidden on the views block form.');
    $this->assertSession()->fieldNotExists('edit-machine-name', NULL);

    // Save the block.
    $edit = ['region' => 'content'];
+2 −2
Original line number Diff line number Diff line
@@ -231,12 +231,12 @@ public function testEditComment() {
    // Make sure the comment field is not visible when
    // the comment was posted by an authenticated user.
    $this->drupalGet('comment/' . $comment->id() . '/edit');
    $this->assertNoFieldById('edit-mail', $comment->getAuthorEmail());
    $this->assertSession()->fieldNotExists('edit-mail');

    // Make sure the comment field is visible when
    // the comment was posted by an anonymous user.
    $this->drupalGet('comment/' . $anonymous_comment->id() . '/edit');
    $this->assertFieldById('edit-mail', $anonymous_comment->getAuthorEmail());
    $this->assertSession()->fieldValueEquals('edit-mail', $anonymous_comment->getAuthorEmail());
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ protected function setUp(): void {
  public function testExport() {
    // Verify the export page with export submit button is available.
    $this->drupalGet('admin/config/development/configuration/full/export');
    $this->assertFieldById('edit-submit', t('Export'));
    $this->assertSession()->buttonExists('Export');

    // Submit the export form and verify response. This will create a file in
    // temporary directory with the default name config.tar.gz.
+4 −4
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ public function testImport() {

    $this->drupalGet('admin/config/development/configuration');
    $this->assertText('There are no configuration changes to import.');
    $this->assertNoFieldById('edit-submit', t('Import all'));
    $this->assertSession()->buttonNotExists('Import all');

    // Create updated configuration object.
    $new_site_name = 'Config import test ' . $this->randomString();
@@ -126,7 +126,7 @@ public function testImport() {
    $this->assertRaw('<td>core.extension');
    $this->assertRaw('<td>system.theme');
    $this->assertRaw('<td>automated_cron.settings');
    $this->assertFieldById('edit-submit', t('Import all'));
    $this->assertSession()->buttonExists('Import all');

    // Import and verify that both do not appear anymore.
    $this->drupalPostForm(NULL, [], t('Import all'));
@@ -136,7 +136,7 @@ public function testImport() {
    $this->assertNoRaw('<td>system.theme');
    $this->assertNoRaw('<td>automated_cron.settings');

    $this->assertNoFieldById('edit-submit', t('Import all'));
    $this->assertSession()->buttonNotExists('Import all');

    // Verify that there are no further changes to import.
    $this->assertText(t('There are no configuration changes to import.'));
@@ -269,7 +269,7 @@ public function testImportSiteUuidValidation() {
    // Verify that there are configuration differences to import.
    $this->drupalGet('admin/config/development/configuration');
    $this->assertText(t('The staged configuration cannot be imported, because it originates from a different site than this site. You can only synchronize configuration between cloned instances of this site.'));
    $this->assertNoFieldById('edit-submit', t('Import all'));
    $this->assertSession()->buttonNotExists('Import all');
  }

  /**
+6 −6
Original line number Diff line number Diff line
@@ -92,9 +92,9 @@ public function testLimitExposedOperators() {

    // Because there are not operators that use the min and max fields, those
    // fields should not be in the exposed form.
    $this->assertFieldById('edit-field-date-value-value');
    $this->assertNoFieldById('edit-field-date-value-min');
    $this->assertNoFieldById('edit-field-date-value-max');
    $this->assertSession()->fieldExists('edit-field-date-value-value');
    $this->assertSession()->fieldNotExists('edit-field-date-value-min');
    $this->assertSession()->fieldNotExists('edit-field-date-value-max');

    $edit = [];
    $edit['options[operator]'] = '>';
@@ -110,9 +110,9 @@ public function testLimitExposedOperators() {
    $this->assertSession()->optionExists('edit-field-date-value-op', '>');
    $this->assertSession()->optionExists('edit-field-date-value-op', '>=');

    $this->assertFieldById('edit-field-date-value-value');
    $this->assertFieldById('edit-field-date-value-min');
    $this->assertFieldById('edit-field-date-value-max');
    $this->assertSession()->fieldExists('edit-field-date-value-value');
    $this->assertSession()->fieldExists('edit-field-date-value-min');
    $this->assertSession()->fieldExists('edit-field-date-value-max');

    // Set the default to an excluded operator.
    $edit = [];
Loading