Unverified Commit 09c6b3d8 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3139428 by jungle, ridhimaabrol24, Hardik_Patel_12, mondrake,...

Issue #3139428 by jungle, ridhimaabrol24, Hardik_Patel_12, mondrake, mrinalini9, Bunty Badgujar: Replace usages of deprecated AssertLegacyTrait::assert(No)FieldChecked()
parent 0f823ffd
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -42,13 +42,13 @@ public function testBlockVisibility() {
    $edit['visibility[request_path][negate]'] = TRUE;
    $edit['visibility[user_role][roles][' . RoleInterface::AUTHENTICATED_ID . ']'] = TRUE;
    $this->drupalGet('admin/structure/block/add/' . $block_name . '/' . $default_theme);
    $this->assertFieldChecked('edit-visibility-request-path-negate-0');
    $this->assertSession()->checkboxChecked('edit-visibility-request-path-negate-0');

    $this->drupalPostForm(NULL, $edit, t('Save block'));
    $this->assertText('The block configuration has been saved.', 'Block was saved');

    $this->clickLink('Configure');
    $this->assertFieldChecked('edit-visibility-request-path-negate-1');
    $this->assertSession()->checkboxChecked('edit-visibility-request-path-negate-1');

    $this->drupalGet('');
    $this->assertText($title, 'Block was displayed on the front page.');
@@ -85,14 +85,14 @@ public function testBlockToggleVisibility() {
    $edit['visibility[user_role][roles][' . RoleInterface::AUTHENTICATED_ID . ']'] = TRUE;
    $this->drupalPostForm('admin/structure/block/add/' . $block_name . '/' . $default_theme, $edit, t('Save block'));
    $this->clickLink('Configure');
    $this->assertFieldChecked('edit-visibility-user-role-roles-authenticated');
    $this->assertSession()->checkboxChecked('edit-visibility-user-role-roles-authenticated');

    $edit = [
      'visibility[user_role][roles][' . RoleInterface::AUTHENTICATED_ID . ']' => FALSE,
    ];
    $this->drupalPostForm(NULL, $edit, 'Save block');
    $this->clickLink('Configure');
    $this->assertNoFieldChecked('edit-visibility-user-role-roles-authenticated');
    $this->assertSession()->checkboxNotChecked('edit-visibility-user-role-roles-authenticated');

    // Ensure that no visibility is configured.
    /** @var \Drupal\block\BlockInterface $block */
@@ -316,7 +316,7 @@ public function testHideBlockTitle() {
    $this->assertText('The block configuration has been saved.', 'Block was saved');

    $this->drupalGet('admin/structure/block/manage/' . $id);
    $this->assertFieldChecked('edit-settings-label-display', 'The display_block option has the correct default value on the configuration form.');
    $this->assertSession()->checkboxChecked('edit-settings-label-display');

    $this->drupalGet('user');
    $this->assertText($title, 'Block title was displayed when enabled.');
+1 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ public function testApprovalNodeInterface() {

    // Approve comment.
    $this->drupalGet('comment/1/edit');
    $this->assertFieldChecked('edit-status-0');
    $this->assertSession()->checkboxChecked('edit-status-0');
    $this->drupalGet('node/' . $this->node->id());
    $this->clickLink(t('Approve'));
    $this->drupalLogout();
+8 −8
Original line number Diff line number Diff line
@@ -403,9 +403,9 @@ public function testCommentFunctionality() {
    ]);
    $this->drupalLogin($limited_user);
    $this->drupalGet('entity_test/structure/entity_test/fields/entity_test.entity_test.comment');
    $this->assertNoFieldChecked('edit-default-value-input-comment-0-status-0');
    $this->assertNoFieldChecked('edit-default-value-input-comment-0-status-1');
    $this->assertFieldChecked('edit-default-value-input-comment-0-status-2');
    $this->assertSession()->checkboxNotChecked('edit-default-value-input-comment-0-status-0');
    $this->assertSession()->checkboxNotChecked('edit-default-value-input-comment-0-status-1');
    $this->assertSession()->checkboxChecked('edit-default-value-input-comment-0-status-2');
    // Test comment option change in field settings.
    $edit = [
      'default_value_input[comment][0][status]' => CommentItemInterface::CLOSED,
@@ -413,9 +413,9 @@ public function testCommentFunctionality() {
    ];
    $this->drupalPostForm(NULL, $edit, t('Save settings'));
    $this->drupalGet('entity_test/structure/entity_test/fields/entity_test.entity_test.comment');
    $this->assertNoFieldChecked('edit-default-value-input-comment-0-status-0');
    $this->assertFieldChecked('edit-default-value-input-comment-0-status-1');
    $this->assertNoFieldChecked('edit-default-value-input-comment-0-status-2');
    $this->assertSession()->checkboxNotChecked('edit-default-value-input-comment-0-status-0');
    $this->assertSession()->checkboxChecked('edit-default-value-input-comment-0-status-1');
    $this->assertSession()->checkboxNotChecked('edit-default-value-input-comment-0-status-2');
    $this->assertFieldByName('settings[anonymous]', CommentInterface::ANONYMOUS_MAY_CONTACT);

    // Add a new comment-type.
@@ -448,8 +448,8 @@ public function testCommentFunctionality() {
    $new_entity = EntityTest::create($data);
    $new_entity->save();
    $this->drupalGet('entity_test/manage/' . $new_entity->id() . '/edit');
    $this->assertNoFieldChecked('edit-field-foobar-0-status-1');
    $this->assertFieldChecked('edit-field-foobar-0-status-2');
    $this->assertSession()->checkboxNotChecked('edit-field-foobar-0-status-1');
    $this->assertSession()->checkboxChecked('edit-field-foobar-0-status-2');
    $this->assertNoField('edit-field-foobar-0-status-0');

    // @todo Check proper url and form https://www.drupal.org/node/2458323
+4 −4
Original line number Diff line number Diff line
@@ -222,10 +222,10 @@ public function testPersonalContactAccess() {
    // Test enabling and disabling the contact page through the user profile
    // form.
    $this->drupalGet('user/' . $this->webUser->id() . '/edit');
    $this->assertNoFieldChecked('edit-contact--2');
    $this->assertSession()->checkboxNotChecked('edit-contact--2');
    $this->assertNull(\Drupal::service('user.data')->get('contact', $this->webUser->id(), 'enabled'), 'Personal contact form disabled');
    $this->drupalPostForm(NULL, ['contact' => TRUE], t('Save'));
    $this->assertFieldChecked('edit-contact--2');
    $this->assertSession()->checkboxChecked('edit-contact--2');
    $this->assertNotEmpty(\Drupal::service('user.data')->get('contact', $this->webUser->id(), 'enabled'), 'Personal contact form enabled');

    // Test with disabled global default contact form in combination with a user
@@ -288,10 +288,10 @@ protected function checkContactAccess($response, $contact_value = NULL) {
    $this->drupalLogin($this->adminUser);
    $this->drupalGet('admin/people/create');
    if ($this->config('contact.settings')->get('user_default_enabled', TRUE)) {
      $this->assertFieldChecked('edit-contact--2');
      $this->assertSession()->checkboxChecked('edit-contact--2');
    }
    else {
      $this->assertNoFieldChecked('edit-contact--2');
      $this->assertSession()->checkboxNotChecked('edit-contact--2');
    }
    $name = $this->randomMachineName();
    $edit = [
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public function testContentTypeUI() {
    // Make sure add page does not inherit translation configuration from first
    // content type.
    $this->drupalGet('admin/structure/types/add');
    $this->assertNoFieldChecked('edit-language-configuration-content-translation');
    $this->assertSession()->checkboxNotChecked('edit-language-configuration-content-translation');

    // Create second content type and set content translation.
    $edit = [
@@ -60,7 +60,7 @@ public function testContentTypeUI() {

    // Make sure the settings are saved when creating the content type.
    $this->drupalGet('admin/structure/types/manage/page');
    $this->assertFieldChecked('edit-language-configuration-content-translation');
    $this->assertSession()->checkboxChecked('edit-language-configuration-content-translation');

  }

Loading