You are here

public function ReplicateUISettingsTest::testSettings in Replicate UI 8

File

tests/src/Functional/ReplicateUISettingsTest.php, line 24

Class

ReplicateUISettingsTest
Tests the replicate settings UI.

Namespace

Drupal\Tests\replicate_ui\Functional

Code

public function testSettings() {
  $this
    ->drupalGet('/admin/config/content/replicate');
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $account = $this
    ->drupalCreateUser([
    'administer site configuration',
  ]);
  $this
    ->drupalLogin($account);
  $this
    ->drupalGet('/admin/config/content/replicate');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->submitForm([
    'entity_types[node]' => 'node',
  ], 'Save configuration');
  $this
    ->assertEquals([
    'node',
  ], \Drupal::configFactory()
    ->get('replicate_ui.settings')
    ->get('entity_types'));
}