Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / field_ui / tests / src / Functional / ManageFieldsTest.php
1 <?php
2
3 namespace Drupal\Tests\field_ui\Functional;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8  * Tests the Manage Display page of a fieldable entity type.
9  *
10  * @group field_ui
11  */
12 class ManageFieldsTest extends BrowserTestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   public static $modules = [
18     'field_ui',
19     'field_ui_test',
20     'node',
21     'text',
22   ];
23
24   /**
25    * {@inheritdoc}
26    */
27   protected function setUp() {
28     parent::setUp();
29     $account = $this->drupalCreateUser(['administer node fields']);
30     $this->drupalLogin($account);
31     $this->config('system.logging')
32       ->set('error_level', ERROR_REPORTING_DISPLAY_ALL)
33       ->save();
34   }
35
36   public function testFieldDropButtonOperations() {
37     $node_type = $this->drupalCreateContentType();
38
39     /** @var \Drupal\field\FieldStorageConfigInterface $storage */
40     $storage = $this->container->get('entity_type.manager')
41       ->getStorage('field_storage_config')
42       ->create([
43         'type' => 'string',
44         'field_name' => 'highlander',
45         'entity_type' => 'node',
46       ]);
47     $storage->save();
48
49     $this->container->get('entity_type.manager')
50       ->getStorage('field_config')
51       ->create([
52         'field_storage' => $storage,
53         'bundle' => $node_type->id(),
54       ])
55       ->save();
56
57     $this->drupalGet('/admin/structure/types/manage/' . $node_type->id() . '/fields');
58
59   }
60
61 }