public function NodeTypeFormTest::testWithNewContentType in Node Option Premium 8
Tests setting premimum for new content type.
File
- tests/
src/ Functional/ Form/ NodeTypeFormTest.php, line 17
Class
- NodeTypeFormTest
- Tests configuring the settings on the node type form.
Namespace
Drupal\Tests\nopremium\Functional\FormCode
public function testWithNewContentType() {
$this
->drupalLogin($this->admin);
// Enable premium on new content type.
$edit = [
'name' => 'Foo',
'type' => 'foo',
'options[premium]' => TRUE,
];
$this
->drupalPostForm('admin/structure/types/add', $edit, 'Save content type');
// Assert that premium was enabled for this content type.
$config = $this
->config('core.base_field_override.node.foo.premium');
$this
->assertEquals(TRUE, $config
->get('default_value')[0]['value']);
}