You are here

public function SettingsFormTest::testNew in Node Option Premium 8

Tests saving settings form without changing anything.

File

tests/src/Functional/Form/SettingsFormTest.php, line 44

Class

SettingsFormTest
Tests configuring the module.

Namespace

Drupal\Tests\nopremium\Functional\Form

Code

public function testNew() {
  $this
    ->drupalLogin($this->adminUser);

  // Test submitting form without changing anything.
  $this
    ->drupalPostForm('/admin/config/content/nopremium', [], 'Save configuration');
  $expected = [
    'default_message' => 'The full content of this page is available to premium users only.',
    'view_modes' => [],
    'teaser_view_mode' => 'teaser',
  ];
  $config = $this
    ->config('nopremium.settings')
    ->getRawData();
  unset($config['_core']);
  $this
    ->assertSame($expected, $config);
}