public function ParagraphsConfigTest::testExcludedParagraphTypes in Paragraphs 8
Same name in this branch
- 8 tests/src/Functional/WidgetLegacy/ParagraphsConfigTest.php \Drupal\Tests\paragraphs\Functional\WidgetLegacy\ParagraphsConfigTest::testExcludedParagraphTypes()
- 8 tests/src/Functional/WidgetStable/ParagraphsConfigTest.php \Drupal\Tests\paragraphs\Functional\WidgetStable\ParagraphsConfigTest::testExcludedParagraphTypes()
Test excluded Paragraph types.
File
- tests/
src/ Functional/ WidgetLegacy/ ParagraphsConfigTest.php, line 224
Class
- ParagraphsConfigTest
- Tests paragraphs configuration.
Namespace
Drupal\Tests\paragraphs\Functional\WidgetLegacyCode
public function testExcludedParagraphTypes() {
$this
->loginAsAdmin();
// Add a Paragraph content type and 2 Paragraphs types.
$this
->addParagraphedContentType('paragraphed_test', 'paragraphs', 'entity_reference_paragraphs');
$this
->addParagraphsType('paragraph_type_test');
$this
->addParagraphsType('text');
$this
->drupalGet('admin/structure/types/manage/paragraphed_test/fields/node.paragraphed_test.paragraphs');
$edit = [
'settings[handler_settings][negate]' => 1,
'settings[handler_settings][target_bundles_drag_drop][text][enabled]' => 1,
];
$this
->submitForm($edit, 'Save settings');
$this
->assertSession()
->pageTextContains('Saved paragraphs configuration.');
$this
->drupalGet('node/add/paragraphed_test');
$this
->assertSession()
->pageTextContains('Add paragraph_type_test');
$this
->assertSession()
->pageTextNotContains('Add text');
}