diff --git a/core/tests/Drupal/FunctionalTests/Field/FieldTypeSortTest.php b/core/tests/Drupal/FunctionalTests/Field/FieldTypeSortTest.php new file mode 100644 index 0000000..5fc4630 --- /dev/null +++ b/core/tests/Drupal/FunctionalTests/Field/FieldTypeSortTest.php @@ -0,0 +1,55 @@ +drupalCreateUser([ + 'administer node fields', + ]); + + $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); + + $this->drupalLogin($web_user); + } + + /** + * Lorem ipsum. + */ + public function testSortOrder() { + $this->drupalGet('admin/structure/types/manage/page/fields/add-field'); + $this->assertSession()->statusCodeEquals(200); + + $this->assertSession()->selectExists('edit-new-storage-type'); + $options = $this->xpath('//select[@id="edit-new-storage-type"]/optgroup[1]/option'); + $options = array_map(function ($element) { return $element->getText(); }, $options); + $sorted = $options; + usort($sorted, 'strnatcasecmp'); + $this->assertEquals($sorted, $options); + } + +}