diff --git a/core/modules/media/tests/src/FunctionalJavascript/ImageTest.php b/core/modules/media/tests/src/FunctionalJavascript/ImageTest.php index 9ef447d..9ee4d14 100644 --- a/core/modules/media/tests/src/FunctionalJavascript/ImageTest.php +++ b/core/modules/media/tests/src/FunctionalJavascript/ImageTest.php @@ -97,21 +97,13 @@ public function testMediaImagePlugin() { ]; $this->createMediaFields($fields, $type_name); - // Adjust the allowed extensions on the file field. - $image_field = FieldConfig::load("media.{$type_name}.{$source_field_id}"); - $image_field->setSetting('file_extensions', 'png jpeg')->save(); - // Hide the media name to test default name generation. $this->hideMediaField('name', $type_name); $this->drupalGet("admin/structure/media/manage/$type_name"); - $this->assertSelectOptions("handler_configuration[image][source_field]", - [$source_field_id], - ['field_string_mime', 'field_string_width', 'field_string_model'] - ); - $page->selectFieldOption("field_mapping[mime]", 'field_string_mime'); - $page->selectFieldOption("field_mapping[width]", 'field_string_width'); - $page->selectFieldOption("field_mapping[model]", 'field_string_model'); + $page->selectFieldOption("field_map[mime]", 'field_string_mime'); + $page->selectFieldOption("field_map[width]", 'field_string_width'); + $page->selectFieldOption("field_map[model]", 'field_string_model'); $page->pressButton('Save'); // Create a media item. diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaHandlerTestBase.php b/core/modules/media/tests/src/FunctionalJavascript/MediaHandlerTestBase.php index 911f339..1d44d39 100644 --- a/core/modules/media/tests/src/FunctionalJavascript/MediaHandlerTestBase.php +++ b/core/modules/media/tests/src/FunctionalJavascript/MediaHandlerTestBase.php @@ -52,7 +52,7 @@ public function createMediaTypeTest($type_name, $type_id, array $provided_fields // Make sure the provided fields are visible on the form. if (!empty($provided_fields)) { foreach ($provided_fields as $provided_field) { - $assert_session->selectExists("field_mapping[$provided_field]"); + $assert_session->selectExists("field_map[$provided_field]"); } } @@ -70,27 +70,4 @@ public function createMediaTypeTest($type_name, $type_id, array $provided_fields return MediaType::load($type_name); } - /** - * Helper to assert presence/absence of select options. - * - * @param string $select - * One of id|name|label|value for the select field. - * @param array $expected_options - * An indexed array of expected option names. - * @param array $non_expected_options - * An indexed array of non-expected option names. - * - * @see \Drupal\Tests\WebAssert::optionExists() - * @see \Drupal\Tests\WebAssert::optionNotExists() - */ - protected function assertSelectOptions($select, $expected_options = [], $non_expected_options = []) { - $assert_session = $this->assertSession(); - foreach ($expected_options as $expected_option) { - $assert_session->optionExists($select, $expected_option); - } - foreach ($non_expected_options as $non_expected_option) { - $assert_session->optionNotExists($select, $non_expected_option); - } - } - }