diff --git a/modules/paragraphs_demo/src/Tests/ParagraphsDemoTest.php b/modules/paragraphs_demo/src/Tests/ParagraphsDemoTest.php new file mode 100644 index 0000000..7f8a72d --- /dev/null +++ b/modules/paragraphs_demo/src/Tests/ParagraphsDemoTest.php @@ -0,0 +1,70 @@ +drupalCreateContentType(array('type' => 'paragraphs', 'name' => 'Paragraphs')); + // Create test user. + $this->adminUser = $this->drupalCreateUser(array( + 'administer site configuration', + 'administer nodes', + 'create article content', + 'administer content types', + 'administer node fields', + 'administer node display', + 'administer paragraphs types', + 'administer paragraph fields', + 'administer paragraph display', + 'administer paragraph form display', + 'administer node form display', + 'edit any article content', + 'delete any article content' + )); + } + + /** + * Asserts demo paragraphs have been created. + */ + protected function testInstalled() { + $this->drupalLogin($this->adminUser); + $this->drupalGet('admin/structure/paragraphs_type'); + $this->assertText('Image + Text'); + $this->assertText('Images'); + $this->assertText('Text'); + $this->assertText('Text + Image'); + $this->assertText('User'); + $this->drupalGet('node/add/paragraphed_content_demo'); $edit = [ + 'title[0][value]' => 'Test Title', + + ]; + $this->drupalPostAjaxForm(NULL, [], ['op' => 'Add Text']); + + $this->drupalPostForm(NULL, $edit, t('Save and Publish')); + } + +}