diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigExportImportUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigExportImportUITest.php
new file mode 100644
index 0000000..6ba6b8e
--- /dev/null
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigExportImportUITest.php
@@ -0,0 +1,82 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\config\Tests\ConfigExportImportUITest.
+ */
+
+namespace Drupal\config\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+class ConfigExportImportUITest extends WebTestBase {
+
+  /**
+   * @var string
+   */
+  protected $slogan;
+
+  /**
+   * @var string
+   */
+  protected $tarball;
+
+  /**
+   * @var string
+   */
+  protected $role;
+
+  const SORT_METHODS = TRUE;
+
+  public static $modules = array('config');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Export/import UI',
+      'description' => 'Tests the user interface for importing/exporting configuration.',
+      'group' => 'Configuration',
+    );
+  }
+
+  protected function setUp() {
+    parent::setUp();
+    // The initial import must be done with uid 1 because if separately named
+    // roles are created then the role is lost after import. If the roles
+    // created have the same name then the sync will fail because they will
+    // have different UUIDs.
+    $this->drupalLogin($this->root_user);
+  }
+
+  function testExport() {
+    // Create a role for second round.
+    $this->role = $this->drupalCreateRole(array('synchronize configuration', 'import configuration'));
+    $this->slogan = $this->randomString(16);
+    \Drupal::config('system.site')
+      ->set('slogan', $this->slogan)
+      ->save();
+    $this->drupalPostForm('admin/config/development/configuration/export', array(), 'Export');
+    $this->tarball = $this->drupalGetContent();
+  }
+
+  function testImport() {
+    $filename = 'temporary://' . $this->randomName();
+    file_put_contents($filename, $this->tarball);
+    $this->doImport($filename);
+    // Now that the role is imported, change the slogan and reimport with a non-root user.
+    $web_user = $this->drupalCreateUser();
+    $web_user->addRole($this->role);
+    $web_user->save();
+    $this->drupalLogin($web_user);
+    \Drupal::config('system.site')
+      ->set('slogan', $this->randomString(16))
+      ->save();
+    $this->doImport($filename);
+  }
+
+  protected function doImport($filename) {
+    $this->assertNotEqual($this->slogan, \Drupal::config('system.site')->get('slogan'));
+    $this->drupalPostForm('admin/config/development/configuration/import', array('files[import_tarball]' => $filename), 'Upload');
+    $this->drupalPostForm(NULL, array(), 'Import all');
+    $this->assertEqual($this->slogan, \Drupal::config('system.site')->get('slogan'));
+  }
+}
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
index 7eb76fd..c2d4b44 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
@@ -748,6 +748,9 @@ public function run(array $methods = array()) {
       }
     }
     else {
+      if (defined("$class::SORT_METHODS")) {
+        sort($class_methods);
+      }
       foreach ($class_methods as $method) {
         // If the current method starts with "test", run it - it's a test.
         if (strtolower(substr($method, 0, 4)) == 'test') {
