Add function saveEntityStub that combines creating and saving

Created on 26 January 2023, almost 2 years ago
Updated 27 January 2023, almost 2 years ago

Problem/Motivation

Very often we need to create an entity stub and save it immediately, with returning the object.
Now we have to use the long construction like this:

    ($node1 = UnitTestHelpers::createEntityStub(Node::class, ['title' => 'Article 1']))->save();

So will be good to simplify it to this:

    $node1 = UnitTestHelpers::saveEntityStub(Node::class, ['title' => 'Article 1']));

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇲Armenia murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024