@@ -28,7 +28,6 @@ protected function setUp()
28
28
}
29
29
30
30
/**
31
- * @magentoApiDataFixture Magento/Customer/_files/customer.php
32
31
* @magentoApiDataFixture Magento/Catalog/_files/categories.php
33
32
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
34
33
*/
@@ -70,14 +69,7 @@ public function testCategoriesTree()
70
69
}
71
70
}
72
71
QUERY ;
73
- // get customer ID token
74
- /** @var \Magento\Integration\Api\CustomerTokenServiceInterface $customerTokenService */
75
- $ customerTokenService = $ this ->objectManager ->create (
76
- \Magento \Integration \Api \CustomerTokenServiceInterface::class
77
- );
78
- $ customerToken = $ customerTokenService ->createCustomerAccessToken ('customer@example.com ' , 'password ' );
79
- $ headerMap = ['Authorization ' => 'Bearer ' . $ customerToken ];
80
- $ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
72
+ $ response = $ this ->graphQlQuery ($ query );
81
73
$ responseDataObject = new DataObject ($ response );
82
74
//Some sort of smoke testing
83
75
self ::assertEquals (
@@ -111,39 +103,22 @@ public function testCategoriesTree()
111
103
}
112
104
113
105
/**
114
- * @magentoApiDataFixture Magento/Customer/_files/customer.php
115
106
* @magentoApiDataFixture Magento/Catalog/_files/categories.php
116
- * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
117
107
*/
118
108
public function testGetCategoryById ()
119
109
{
120
- $ rootCategoryId = 13 ;
110
+ $ categoryId = 13 ;
121
111
$ query = <<<QUERY
122
112
{
123
- category(id: {$ rootCategoryId }) {
113
+ category(id: {$ categoryId }) {
124
114
id
125
115
name
126
116
}
127
117
}
128
118
QUERY ;
129
- // get customer ID token
130
- /** @var \Magento\Integration\Api\CustomerTokenServiceInterface $customerTokenService */
131
- $ customerTokenService = $ this ->objectManager ->create (
132
- \Magento \Integration \Api \CustomerTokenServiceInterface::class
133
- );
134
- $ customerToken = $ customerTokenService ->createCustomerAccessToken ('customer@example.com ' , 'password ' );
135
- $ headerMap = ['Authorization ' => 'Bearer ' . $ customerToken ];
136
- $ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
137
- $ responseDataObject = new DataObject ($ response );
138
- //Some sort of smoke testing
139
- self ::assertEquals (
140
- 'Category 1.2 ' ,
141
- $ responseDataObject ->getData ('category/name ' )
142
- );
143
- self ::assertEquals (
144
- 13 ,
145
- $ responseDataObject ->getData ('category/id ' )
146
- );
119
+ $ response = $ this ->graphQlQuery ($ query );
120
+ self ::assertEquals ('Category 1.2 ' , $ response ['category ' ]['name ' ]);
121
+ self ::assertEquals (13 , $ response ['category ' ]['id ' ]);
147
122
}
148
123
149
124
/**
0 commit comments