EntityQueryServiceStub
in package
implements
QueryFactoryInterface
A stub of the Drupal's default QueryFactoryInterface class.
@package TestHelpers\DrupalServiceStubs
Table of Contents
Interfaces
- QueryFactoryInterface
Properties
- $namespaces : array<string|int, mixed>
- The list of namespaces.
- $stubQueryStubFactory : EntityQueryStubFactory
- An EntityQueryStubFactory factory.
Methods
- __construct() : mixed
- {@inheritdoc}
- get() : mixed
- {@inheritdoc}
- getAggregate() : mixed
- {@inheritdoc}
- stubCheckConditionsMatch() : bool
- Checks if the passed conditions matches to configured.
- stubGetExecuteBaseFunction() : mixed
- Returns the base execute function closure.
- stubSetExecuteHandler() : mixed
- Sets the function to handle execute calls.
Properties
$namespaces
The list of namespaces.
protected
array<string|int, mixed>
$namespaces
$stubQueryStubFactory
An EntityQueryStubFactory factory.
protected
EntityQueryStubFactory
$stubQueryStubFactory
Methods
__construct()
{@inheritdoc}
public
__construct() : mixed
get()
{@inheritdoc}
public
get(mixed $entityType, mixed $conjunction) : mixed
Parameters
- $entityType : mixed
- $conjunction : mixed
getAggregate()
{@inheritdoc}
public
getAggregate(mixed $entityType, mixed $conjunction) : mixed
Parameters
- $entityType : mixed
- $conjunction : mixed
stubCheckConditionsMatch()
Checks if the passed conditions matches to configured.
public
stubCheckConditionsMatch(ConditionInterface $conditionsExpected[, bool $onlyListed = FALSE ][, bool $throwErrors = TRUE ]) : bool
Parameters
- $conditionsExpected : ConditionInterface
-
The expected conditions.
- $onlyListed : bool = FALSE
-
Return FALSE if class contains more conditions than expected.
- $throwErrors : bool = TRUE
-
Enables throwing notice errors when matching fails, with the explanation what exactly doesn't match.
Return values
bool —TRUE if matchs, FALSE if not matchs.
stubGetExecuteBaseFunction()
Returns the base execute function closure.
public
static stubGetExecuteBaseFunction() : mixed
stubSetExecuteHandler()
Sets the function to handle execute calls.
public
stubSetExecuteHandler(callable $function[, string $entityTypeId = 'all' ]) : mixed
You can call $this->stubExecuteBase()
in your custom callback function
to execute the base stub behavior for the query.
Parameters
- $function : callable
-
The execute function.
- $entityTypeId : string = 'all'
-
The entity type to attach, all entity types by default.