trait StubTestTrait (View source)

Provides common functionality for testing stubbing.

Methods

performStubTest(string $entity_type_id)

Test that creating a stub of the given entity type results in a valid entity.

int
createEntityStub(string $entity_type_id)

Create a stub of the given entity type.

validateStub(string $entity_type_id, string $entity_id)

Perform validation on a stub entity.

Details

protected performStubTest(string $entity_type_id)

Test that creating a stub of the given entity type results in a valid entity.

Parameters

string $entity_type_id

The entity type we are stubbing.

protected int createEntityStub(string $entity_type_id)

Create a stub of the given entity type.

Parameters

string $entity_type_id

The entity type we are stubbing.

Return Value

int

ID of the created entity.

protected EntityConstraintViolationListInterface validateStub(string $entity_type_id, string $entity_id)

Perform validation on a stub entity.

Parameters

string $entity_type_id

The entity type we are stubbing.

string $entity_id

ID of the stubbed entity to validate.

Return Value

EntityConstraintViolationListInterface

List of constraint violations identified.