$resource_type =
$this->resourceTypeRepository->
get('node', 'painting'
);
foreach ($data as $case) { $parameter =
$case[0
];
$expected_query =
$case[1
];
$filter = Filter::
createFromQueryParameter($parameter,
$resource_type,
$this->fieldResolver
);
$query =
$this->nodeStorage->
getQuery()->
accessCheck(FALSE
);
// Get the query condition parsed from the input.
$condition =
$filter->
queryCondition($query);
// Apply it to the query.
$query->
condition($condition);
// Verify the SQL query is exactly the same.
$expected_sql_query =
$get_sql_query_for_entity_query($expected_query);
$actual_sql_query =
$get_sql_query_for_entity_query($query);
$this->
assertSame($expected_sql_query,
$actual_sql_query);
// Compare the results.
$this->
assertEquals($expected_query->
execute(),
$query->
execute());
}