Unverified Commit 09c6b3d8 authored by alexpott's avatar alexpott
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
......@@ -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.');
......
......@@ -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();
......
......@@ -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
......
......@@ -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 = [
......
......@@ -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');
}
......
......@@ -158,7 +158,7 @@ public function testSettingsUI() {
// Verify language widget appears on comment type form.
$this->drupalGet('admin/structure/comment/manage/comment_article');
$this->assertField('language_configuration[content_translation]');
$this->assertFieldChecked('edit-language-configuration-content-translation');
$this->assertSession()->checkboxChecked('edit-language-configuration-content-translation');
// Verify that translation may be enabled for the article content type.
$edit = [
......@@ -167,10 +167,10 @@ public function testSettingsUI() {
// Make sure the checkbox is available and not checked by default.
$this->drupalGet('admin/structure/types/manage/article');
$this->assertField('language_configuration[content_translation]');
$this->assertNoFieldChecked('edit-language-configuration-content-translation');
$this->assertSession()->checkboxNotChecked('edit-language-configuration-content-translation');
$this->drupalPostForm('admin/structure/types/manage/article', $edit, t('Save content type'));
$this->drupalGet('admin/structure/types/manage/article');
$this->assertFieldChecked('edit-language-configuration-content-translation');
$this->assertSession()->checkboxChecked('edit-language-configuration-content-translation');
// Test that the title field of nodes is available in the settings form.
$edit = [
......@@ -228,14 +228,14 @@ public function testAccountLanguageSettingsUI() {
// Make sure the checkbox is available and not checked by default.
$this->drupalGet('admin/config/people/accounts');
$this->assertField('language[content_translation]');
$this->assertNoFieldChecked('edit-language-content-translation');
$this->assertSession()->checkboxNotChecked('edit-language-content-translation');
$edit = [
'language[content_translation]' => TRUE,
];
$this->drupalPostForm('admin/config/people/accounts', $edit, t('Save configuration'));
$this->drupalGet('admin/config/people/accounts');
$this->assertFieldChecked('edit-language-content-translation');
$this->assertSession()->checkboxChecked('edit-language-content-translation');
// Make sure account settings can be saved.
$this->drupalPostForm('admin/config/people/accounts', ['anonymous' => 'Save me please!'], 'Save configuration');
......
......@@ -103,8 +103,8 @@ public function testImageFieldSync() {
// Check that the alt and title fields are enabled for the image field.
$this->drupalLogin($this->editor);
$this->drupalGet('entity_test_mul/structure/' . $this->entityTypeId . '/fields/' . $this->entityTypeId . '.' . $this->entityTypeId . '.' . $this->fieldName);
$this->assertFieldChecked('edit-third-party-settings-content-translation-translation-sync-alt');
$this->assertFieldChecked('edit-third-party-settings-content-translation-translation-sync-title');
$this->assertSession()->checkboxChecked('edit-third-party-settings-content-translation-translation-sync-alt');
$this->assertSession()->checkboxChecked('edit-third-party-settings-content-translation-translation-sync-title');
$edit = [
'third_party_settings[content_translation][translation_sync][alt]' => FALSE,
'third_party_settings[content_translation][translation_sync][title]' => FALSE,
......@@ -114,8 +114,8 @@ public function testImageFieldSync() {
// Check that the content translation settings page reflects the changes
// performed in the field edit page.
$this->drupalGet('admin/config/regional/content-language');
$this->assertNoFieldChecked('edit-settings-entity-test-mul-entity-test-mul-columns-field-test-et-ui-image-alt');
$this->assertNoFieldChecked('edit-settings-entity-test-mul-entity-test-mul-columns-field-test-et-ui-image-title');
$this->assertSession()->checkboxNotChecked('edit-settings-entity-test-mul-entity-test-mul-columns-field-test-et-ui-image-alt');
$this->assertSession()->checkboxNotChecked('edit-settings-entity-test-mul-entity-test-mul-columns-field-test-et-ui-image-title');
$edit = [
'settings[entity_test_mul][entity_test_mul][fields][field_test_et_ui_image]' => TRUE,
'settings[entity_test_mul][entity_test_mul][columns][field_test_et_ui_image][alt]' => TRUE,
......@@ -124,8 +124,8 @@ public function testImageFieldSync() {
$this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration'));
$errors = $this->xpath('//div[contains(@class, "messages--error")]');
$this->assertEmpty($errors, 'Settings correctly stored.');
$this->assertFieldChecked('edit-settings-entity-test-mul-entity-test-mul-columns-field-test-et-ui-image-alt');
$this->assertFieldChecked('edit-settings-entity-test-mul-entity-test-mul-columns-field-test-et-ui-image-title');
$this->assertSession()->checkboxChecked('edit-settings-entity-test-mul-entity-test-mul-columns-field-test-et-ui-image-alt');
$this->assertSession()->checkboxChecked('edit-settings-entity-test-mul-entity-test-mul-columns-field-test-et-ui-image-title');
$this->drupalLogin($this->translator);
$default_langcode = $this->langcodes[0];
......
......@@ -160,7 +160,7 @@ public function testBooleanFilterHandler() {
$this->drupalPostForm(NULL, ['options[value]' => 'All', 'options[expose][required]' => FALSE], 'Apply');
$this->drupalPostForm(NULL, [], 'Save');
$this->drupalGet('/admin/structure/views/nojs/handler/test_view_fieldapi/default/filter/field_boolean_value');
$this->assertFieldChecked('edit-options-value-all');
$this->assertSession()->checkboxChecked('edit-options-value-all');
}
}
......@@ -58,7 +58,7 @@ public function testLanguageConfigurationElement() {
$this->assertFalse($lang_conf->isLanguageAlterable());
$this->drupalGet('language-tests/language_configuration_element');
$this->assertTrue($this->assertSession()->optionExists('edit-lang-configuration-langcode', 'current_interface')->isSelected());
$this->assertNoFieldChecked('edit-lang-configuration-language-alterable');
$this->assertSession()->checkboxNotChecked('edit-lang-configuration-language-alterable');
// Reload the page and save again.
$this->drupalGet('language-tests/language_configuration_element');
......@@ -72,7 +72,7 @@ public function testLanguageConfigurationElement() {
$this->assertTrue($lang_conf->isLanguageAlterable());
$this->drupalGet('language-tests/language_configuration_element');
$this->assertTrue($this->assertSession()->optionExists('edit-lang-configuration-langcode', 'authors_default')->isSelected());
$this->assertFieldChecked('edit-lang-configuration-language-alterable');
$this->assertSession()->checkboxChecked('edit-lang-configuration-language-alterable');
// Test if content type settings have been saved.
$edit = [
......@@ -86,7 +86,7 @@ public function testLanguageConfigurationElement() {
// Make sure the settings are saved when creating the content type.
$this->drupalGet('admin/structure/types/manage/page');
$this->assertTrue($this->assertSession()->optionExists('edit-language-configuration-langcode', 'authors_default')->isSelected());
$this->assertFieldChecked('edit-language-configuration-language-alterable');
$this->assertSession()->checkboxChecked('edit-language-configuration-language-alterable');
}
......
......@@ -70,7 +70,7 @@ public function testLanguageConfiguration() {
// Check if we can change the default language.
$this->drupalGet('admin/config/regional/language');
$this->assertFieldChecked('edit-site-default-language-en', 'English is the default language.');
$this->assertSession()->checkboxChecked('edit-site-default-language-en');
// Change the default language.
$edit = [
......@@ -78,7 +78,7 @@ public function testLanguageConfiguration() {
];
$this->drupalPostForm(NULL, $edit, t('Save configuration'));
$this->rebuildContainer();
$this->assertFieldChecked('edit-site-default-language-fr', 'Default language updated.');
$this->assertSession()->checkboxChecked('edit-site-default-language-fr');
$this->assertUrl(Url::fromRoute('entity.configurable_language.collection', [], ['absolute' => TRUE, 'langcode' => 'fr'])->toString(), [], 'Correct page redirection.');
// Check if a valid language prefix is added after changing the default
......
......@@ -47,7 +47,7 @@ public function testLanguageConfiguration() {
$this->assertText(t('@name field is required.', ['@name' => t('Language code')]));
$this->assertText(t('@name field is required.', ['@name' => t('Language name')]));
$empty_language = new Language();
$this->assertFieldChecked('edit-direction-' . $empty_language->getDirection(), 'Consistent usage of language direction.');
$this->assertSession()->checkboxChecked('edit-direction-' . $empty_language->getDirection());
$this->assertUrl(Url::fromRoute('language.add', [], ['absolute' => TRUE])->toString(), [], 'Correct page redirection.');
// Test validation of invalid values.
......
......@@ -79,14 +79,14 @@ public function testLanguageList() {
// Check if we can change the default language.
$path = 'admin/config/regional/language';
$this->drupalGet($path);
$this->assertFieldChecked('edit-site-default-language-en', 'English is the default language.');
$this->assertSession()->checkboxChecked('edit-site-default-language-en');
// Change the default language.
$edit = [
'site_default_language' => $langcode,
];
$this->drupalPostForm(NULL, $edit, t('Save configuration'));
$this->rebuildContainer();
$this->assertNoFieldChecked('edit-site-default-language-en', 'Default language updated.');
$this->assertSession()->checkboxNotChecked('edit-site-default-language-en');
$this->assertUrl(Url::fromRoute('entity.configurable_language.collection', [], ['absolute' => TRUE, 'language' => $language])->toString());
// Ensure we can't delete the default language.
......@@ -164,14 +164,14 @@ public function testLanguageList() {
// Check if we can change the default language.
$path = 'admin/config/regional/language';
$this->drupalGet($path);
$this->assertFieldChecked('edit-site-default-language-en', 'English is the default language.');
$this->assertSession()->checkboxChecked('edit-site-default-language-en');
// Change the default language.
$edit = [
'site_default_language' => $langcode,
];
$this->drupalPostForm(NULL, $edit, t('Save configuration'));
$this->rebuildContainer();
$this->assertNoFieldChecked('edit-site-default-language-en', 'Default language updated.');
$this->assertSession()->checkboxNotChecked('edit-site-default-language-en');
$this->assertUrl(Url::fromRoute('entity.configurable_language.collection', [], ['absolute' => TRUE, 'language' => $language])->toString());
$this->drupalPostForm('admin/config/regional/language/delete/en', [], t('Delete'));
......@@ -200,7 +200,7 @@ public function testLanguageList() {
$this->drupalPostForm(NULL, ['site_default_language' => 'nl'], 'Save configuration');
$this->assertText(t('Selected default language no longer exists.'));
$this->assertNoFieldChecked('edit-site-default-language-xx', 'The previous default language got deselected.');
$this->assertSession()->checkboxNotChecked('edit-site-default-language-xx');
}
/**
......
......@@ -502,8 +502,8 @@ protected function doMenuLinkFormDefaultsTest() {
$this->assertFieldByName('title[0][value]', '');
$this->assertFieldByName('link[0][uri]', '');
$this->assertNoFieldChecked('edit-expanded-value');
$this->assertFieldChecked('edit-enabled-value');
$this->assertSession()->checkboxNotChecked('edit-expanded-value');
$this->assertSession()->checkboxChecked('edit-enabled-value');
$this->assertFieldByName('description[0][value]', '');
$this->assertFieldByName('weight[0][value]', 0);
......
......@@ -65,8 +65,8 @@ public function testMultiStepNodeFormBasicOptions() {
"{$this->fieldName}[0][value]" => $this->randomString(32),
];
$this->drupalPostForm('node/add/page', $edit, t('Add another item'));
$this->assertNoFieldChecked('edit-promote-value', 'Promote stayed unchecked');
$this->assertFieldChecked('edit-sticky-value', 'Sticky stayed checked');
$this->assertSession()->checkboxNotChecked('edit-promote-value');
$this->assertSession()->checkboxChecked('edit-sticky-value');
}
}
......@@ -68,7 +68,7 @@ public function testDisplayRevisionTab() {
// Verify the checkbox is checked on the node edit form.
$this->drupalGet('node/' . $node->id() . '/edit');
$this->assertFieldChecked('edit-revision', "'Create new revision' checkbox is checked");
$this->assertSession()->checkboxChecked('edit-revision');
// Uncheck the create new revision checkbox and save the node.
$edit = ['revision' => FALSE];
......@@ -80,7 +80,7 @@ public function testDisplayRevisionTab() {
// Verify the checkbox is checked on the node edit form.
$this->drupalGet('node/' . $node->id() . '/edit');
$this->assertFieldChecked('edit-revision', "'Create new revision' checkbox is checked");
$this->assertSession()->checkboxChecked('edit-revision');
// Submit the form without changing the checkbox.
$edit = [];
......@@ -100,7 +100,7 @@ public function testDisplayRevisionTab() {
// Verify the checkbox is unchecked on the node edit form.
$this->drupalGet('node/' . $node->id() . '/edit');
$this->assertNoFieldChecked('edit-revision', "'Create new revision' checkbox is unchecked");
$this->assertSession()->checkboxNotChecked('edit-revision');
// Submit the form without changing the checkbox.
$edit = [];
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
......@@ -112,7 +112,7 @@ public function testDisplayRevisionTab() {
// Verify the checkbox is unchecked on the node edit form.
$this->drupalGet('node/' . $node->id() . '/edit');
$this->assertNoFieldChecked('edit-revision', "'Create new revision' checkbox is unchecked");
$this->assertSession()->checkboxNotChecked('edit-revision');
// Check the 'create new revision' checkbox and save the node.
$edit = ['revision' => TRUE];
......
......@@ -57,7 +57,7 @@ public function testNodeFormSaveWithoutRevision() {
// Verify the checkbox is checked on the node edit form.
$this->drupalGet('node/' . $node->id() . '/edit');
$this->assertFieldChecked('edit-revision', "'Create new revision' checkbox is checked");
$this->assertSession()->checkboxChecked('edit-revision');
// Uncheck the create new revision checkbox and save the node.
$edit = ['revision' => FALSE];
......@@ -70,7 +70,7 @@ public function testNodeFormSaveWithoutRevision() {
// Verify the checkbox is checked on the node edit form.
$this->drupalGet('node/' . $node->id() . '/edit');
$this->assertFieldChecked('edit-revision', "'Create new revision' checkbox is checked");
$this->assertSession()->checkboxChecked('edit-revision');
// Submit the form without changing the checkbox.
$edit = [];
......
......@@ -46,7 +46,7 @@ protected function setUp(): void {
public function testNodeTypeInitialLanguageDefaults() {
$this->drupalGet('admin/structure/types/manage/article');
$this->assertTrue($this->assertSession()->optionExists('edit-language-configuration-langcode', LanguageInterface::LANGCODE_SITE_DEFAULT)->isSelected());
$this->assertNoFieldChecked('edit-language-configuration-language-alterable', 'Language selector is hidden by default.');
$this->assertSession()->checkboxNotChecked('edit-language-configuration-language-alterable');
// Tests if the language field cannot be rearranged on the manage fields tab.
$this->drupalGet('admin/structure/types/manage/article/fields');
......
......@@ -408,7 +408,7 @@ public function testPagePreview() {
];
$this->drupalPostForm(NULL, $edit, t('Preview'));
$this->clickLink(t('Back to content editing'));
$this->assertFieldChecked('edit-menu-enabled', 'Menu option is still checked');
$this->assertSession()->checkboxChecked('edit-menu-enabled');
$this->assertFieldByName('menu[title]', 'Changed title', 'Menu link title is correct after preview');
// Save, change the title while saving and make sure that it is correctly
......
......@@ -145,9 +145,9 @@ public function testRadioButtons() {
// With no field data, no buttons are checked.
$this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
$this->assertNoFieldChecked('edit-card-1-0');
$this->assertNoFieldChecked('edit-card-1-1');
$this->assertNoFieldChecked('edit-card-1-2');
$this->assertSession()->checkboxNotChecked('edit-card-1-0');
$this->assertSession()->checkboxNotChecked('edit-card-1-1');
$this->assertSession()->checkboxNotChecked('edit-card-1-2');
$this->assertRaw('Some dangerous &amp; unescaped <strong>markup</strong>', 'Option text was properly filtered.');
$this->assertRaw('Some HTML encoded markup with &lt; &amp; &gt;');
......@@ -158,9 +158,9 @@ public function testRadioButtons() {
// Check that the selected button is checked.
$this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
$this->assertFieldChecked('edit-card-1-0');
$this->assertNoFieldChecked('edit-card-1-1');
$this->assertNoFieldChecked('edit-card-1-2');
$this->assertSession()->checkboxChecked('edit-card-1-0');
$this->assertSession()->checkboxNotChecked('edit-card-1-1');
$this->assertSession()->checkboxNotChecked('edit-card-1-2');
// Unselect option.
$edit = ['card_1' => '_none'];
......@@ -173,7 +173,7 @@ public function testRadioButtons() {
$field->setRequired(TRUE);
$field->save();
$this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
$this->assertFieldChecked('edit-card-1-99');
$this->assertSession()->checkboxChecked('edit-card-1-99');
}
/**
......@@ -203,9 +203,9 @@ public function testCheckBoxes() {
// Display form: with no field data, nothing is checked.
$this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
$this->assertNoFieldChecked('edit-card-2-0');
$this->assertNoFieldChecked('edit-card-2-1');
$this->assertNoFieldChecked('edit-card-2-2');
$this->assertSession()->checkboxNotChecked('edit-card-2-0');
$this->assertSession()->checkboxNotChecked('edit-card-2-1');
$this->assertSession()->checkboxNotChecked('edit-card-2-2');
$this->assertRaw('Some dangerous &amp; unescaped <strong>markup</strong>', 'Option text was properly filtered.');
// Submit form: select first and third options.
......@@ -219,9 +219,9 @@ public function testCheckBoxes() {
// Display form: check that the right options are selected.
$this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
$this->assertFieldChecked('edit-card-2-0');
$this->assertNoFieldChecked('edit-card-2-1');
$this->assertFieldChecked('edit-card-2-2');
$this->assertSession()->checkboxChecked('edit-card-2-0');
$this->assertSession()->checkboxNotChecked('edit-card-2-1');
$this->assertSession()->checkboxChecked('edit-card-2-2');
// Submit form: select only first option.
$edit = [
......@@ -234,9 +234,9 @@ public function testCheckBoxes() {
// Display form: check that the right options are selected.
$this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
$this->assertFieldChecked('edit-card-2-0');
$this->assertNoFieldChecked('edit-card-2-1');
$this->assertNoFieldChecked('edit-card-2-2');
$this->assertSession()->checkboxChecked('edit-card-2-0');
$this->assertSession()->checkboxNotChecked('edit-card-2-1');
$this->assertSession()->checkboxNotChecked('edit-card-2-2');
// Submit form: select the three options while the field accepts only 2.
$edit = [
......@@ -263,7 +263,7 @@ public function testCheckBoxes() {
$field->setRequired(TRUE);
$field->save();
$this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
$this->assertFieldChecked('edit-card-2-99');
$this->assertSession()->checkboxChecked('edit-card-2-99');
}
/**
......
......@@ -132,9 +132,9 @@ public function testResponsiveImageAdmin() {
// Check the mapping for multipliers 1x and 2x for the narrow breakpoint.
$this->assertFieldByName('keyed_styles[responsive_image_test_module.narrow][1x][image_mapping_type]', 'sizes');
$this->assertFieldByName('keyed_styles[responsive_image_test_module.narrow][1x][sizes]', '(min-resolution: 192dpi) and (min-width: 170px) 386px, (min-width: 170px) 193px, (min-width: 768px) 18vw, (min-width: 480px) 30vw, 48vw');
$this->assertFieldChecked('edit-keyed-styles-responsive-image-test-modulenarrow-1x-sizes-image-styles-large');
$this->assertFieldChecked('edit-keyed-styles-responsive-image-test-modulenarrow-1x-sizes-image-styles-medium');
$this->assertNoFieldChecked('edit-keyed-styles-responsive-image-test-modulenarrow-1x-sizes-image-styles-thumbnail');
$this->assertSession()->checkboxChecked('edit-keyed-styles-responsive-image-test-modulenarrow-1x-sizes-image-styles-large');
$this->assertSession()->checkboxChecked('edit-keyed-styles-responsive-image-test-modulenarrow-1x-sizes-image-styles-medium');
$this->assertSession()->checkboxNotChecked('edit-keyed-styles-responsive-image-test-modulenarrow-1x-sizes-image-styles-thumbnail');
$this->assertFieldByName('keyed_styles[responsive_image_test_module.narrow][2x][image_mapping_type]', '_none');
// Check the mapping for multipliers 1x and 2x for the wide breakpoint.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment