X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fparagraphs%2Fsrc%2FTests%2FExperimental%2FParagraphsExperimentalTypesTest.php;fp=web%2Fmodules%2Fcontrib%2Fparagraphs%2Fsrc%2FTests%2FExperimental%2FParagraphsExperimentalTypesTest.php;h=773439efc28ffe804e8758b6b3314bde288fae8c;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/paragraphs/src/Tests/Experimental/ParagraphsExperimentalTypesTest.php b/web/modules/contrib/paragraphs/src/Tests/Experimental/ParagraphsExperimentalTypesTest.php new file mode 100644 index 000000000..773439efc --- /dev/null +++ b/web/modules/contrib/paragraphs/src/Tests/Experimental/ParagraphsExperimentalTypesTest.php @@ -0,0 +1,41 @@ +loginAsAdmin(); + // Add a Paragraphed test content. + $this->addParagraphedContentType('paragraphed_test', 'paragraphs'); + + $this->addParagraphsType('paragraph_type_test'); + $this->addParagraphsType('text'); + + // Attempt to delete the content type not used yet. + $this->drupalGet('admin/structure/paragraphs_type'); + $this->clickLink(t('Delete')); + $this->assertText('This action cannot be undone.'); + $this->clickLink(t('Cancel')); + + // Add a test node with a Paragraph. + $this->drupalGet('node/add/paragraphed_test'); + $this->drupalPostAjaxForm(NULL, [], 'paragraphs_paragraph_type_test_add_more'); + $this->drupalPostForm(NULL, ['title[0][value]' => 'test_node'], t('Save and publish')); + $this->assertText('paragraphed_test test_node has been created.'); + + // Attempt to delete the paragraph type already used. + $this->drupalGet('admin/structure/paragraphs_type'); + $this->clickLink(t('Delete')); + $this->assertText('paragraph_type_test Paragraphs type is used by 1 piece of content on your site. You can not remove this paragraph_type_test Paragraphs type until you have removed all from the content.'); + } + +}