22 private $graphQlClient;
41 array $variables = [],
42 string $operationName =
'',
45 return $this->getGraphQlClient()->postQuery(
49 $this->composeHeaders($headers)
56 private function composeHeaders($headers)
59 foreach ($headers as $key =>
$value) {
60 $headersArray[] = sprintf(
'%s: %s', $key,
$value);
72 return $this->getAppCache()->clean(\
Magento\Framework\
App\Config::CACHE_TAG);
80 private function getAppCache()
82 if (
null === $this->appCache) {
85 return $this->appCache;
93 private function getGraphQlClient()
95 if ($this->graphQlClient ===
null) {
97 \
Magento\TestFramework\TestCase\GraphQl\Client::class
100 return $this->graphQlClient;
112 foreach ($assertionMap as $key => $assertionData) {
113 $expectedValue = isset($assertionData[
'expected_value'])
114 ? $assertionData[
'expected_value']
116 $responseField = isset($assertionData[
'response_field']) ? $assertionData[
'response_field'] : $key;
119 "Value of '{$responseField}' field must not be NULL" 123 $actualResponse[$responseField],
124 "Value of '{$responseField}' field in response does not match expected value: " 125 . var_export($expectedValue,
true)
assertResponseFields($actualResponse, $assertionMap)
graphQlQuery(string $query, array $variables=[], string $operationName='', array $headers=[])
static getObjectManager()