Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
api-functional
testsuite
Magento
GraphQl
TestModule
GraphQlMutationTest.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\GraphQl\TestModule
;
9
10
use
Magento\TestFramework\TestCase\GraphQlAbstract
;
11
15
class
GraphQlMutationTest
extends
GraphQlAbstract
16
{
17
public
function
testMutation
()
18
{
19
$id
= 3;
20
21
$query
= <<<MUTATION
22
mutation {
23
testItem(
id
: {
$id
}) {
24
item_id,
25
name
,
26
integer_list
27
}
28
}
29
MUTATION;
30
31
$response
= $this->
graphQlQuery
(
$query
);
32
$this->assertArrayHasKey(
'testItem'
,
$response
);
33
$testItem =
$response
[
'testItem'
];
34
$this->assertArrayHasKey(
'integer_list'
, $testItem);
35
$this->assertEquals([4, 5, 6], $testItem[
'integer_list'
]);
36
}
37
}
$response
$response
Definition:
404.php:11
Magento\TestFramework\TestCase\GraphQlAbstract
Definition:
GraphQlAbstract.php:15
$id
$id
Definition:
fieldset.phtml:14
Magento\GraphQl\TestModule\GraphQlMutationTest
Definition:
GraphQlMutationTest.php:15
name
$query
$query
Definition:
popular_query.php:9
Magento\GraphQl\TestModule\GraphQlMutationTest\testMutation
testMutation()
Definition:
GraphQlMutationTest.php:17
Magento\GraphQl\TestModule
Definition:
GraphQlMutationTest.php:8
Magento\TestFramework\TestCase\GraphQlAbstract\graphQlQuery
graphQlQuery(string $query, array $variables=[], string $operationName='', array $headers=[])
Definition:
GraphQlAbstract.php:39