ParagraphsAlterByTypeTest.php in Paragraphs 8
File
tests/src/Functional/WidgetStable/ParagraphsAlterByTypeTest.php
View source
<?php
namespace Drupal\Tests\paragraphs\Functional\WidgetStable;
class ParagraphsAlterByTypeTest extends ParagraphsTestBase {
public static $modules = [
'paragraphs_test',
];
public function testAlterBasedOnType() {
$this
->addParagraphedContentType('paragraphed_test', 'field_paragraphs', 'entity_reference_paragraphs');
$this
->loginAsAdmin([
'create paragraphed_test content',
'edit any paragraphed_test content',
]);
$paragraph_type = 'altered_paragraph';
$this
->addParagraphsType($paragraph_type);
static::fieldUIAddNewField('admin/structure/paragraphs_type/' . $paragraph_type, 'text', 'Normal title', 'text_long', [], []);
$this
->drupalGet('node/add/paragraphed_test');
$this
->assertSession()
->pageTextContains('Altered title');
}
}