-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added an AfterScenario for ParagraphsTrait #71
Added an AfterScenario for ParagraphsTrait #71
Conversation
to delete all paragraph created using this trait.
* | ||
* @var array | ||
*/ | ||
protected $paragraph = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protected static $paragraphs = [];
* | ||
* @AfterScenario | ||
*/ | ||
public function paragraphCleanAll(AfterScenarioScope $scope) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function paragraphsCleanAll(AfterScenarioScope $scope) {
return; | ||
} | ||
|
||
foreach ($this->paragraph as $paragraph) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
foreach (static::$paragraphs as $paragraph) {
@@ -80,6 +111,7 @@ protected function paragraphsAttachFromStubToEntity(ContentEntityInterface $enti | |||
'target_revision_id' => $paragraph->getRevisionId(), | |||
]; | |||
$entity->set($entity_field_name, $new_value)->save(); | |||
$this->paragraph[] = $paragraph; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static::$paragraphs[] = $paragraph;
@joshua1234511 Minor changes are required, but I will make them after this PR is merged to speed up the delivery. |
Added an AfterScenario for ParagraphsTrait, to delete all paragraph created using this trait.
Use case