@@ -53,24 +53,16 @@ public function testQueryAllFieldsDownloadableProductsWithDownloadableFileAndSam
53
53
links_purchased_separately
54
54
55
55
downloadable_product_links{
56
- id
57
56
sample_url
58
- sample_type
59
-
60
- is_shareable
61
- number_of_downloads
62
57
sort_order
63
58
title
64
- link_type
65
-
66
59
price
67
60
}
68
61
downloadable_product_samples{
69
62
title
70
63
sort_order
71
64
sort_order
72
- sample_type
73
- sample_file
65
+ sample_url
74
66
}
75
67
}
76
68
}
@@ -82,8 +74,6 @@ public function testQueryAllFieldsDownloadableProductsWithDownloadableFileAndSam
82
74
$ config = ObjectManager::getInstance ()->get (\Magento \Config \Model \ResourceModel \Config::class);
83
75
$ config ->saveConfig (
84
76
\Magento \Downloadable \Model \Link::XML_PATH_CONFIG_IS_SHAREABLE ,
85
- 0 ,
86
- ScopeConfigInterface::SCOPE_TYPE_DEFAULT ,
87
77
0
88
78
);
89
79
$ response = $ this ->graphQlQuery ($ query );
@@ -143,22 +133,15 @@ public function testDownloadableProductQueryWithNoSample()
143
133
links_purchased_separately
144
134
145
135
downloadable_product_links{
146
- id
147
136
sample_url
148
- sample_type
149
- is_shareable
150
- number_of_downloads
151
137
sort_order
152
138
title
153
- link_type
154
139
price
155
140
}
156
141
downloadable_product_samples{
157
142
title
158
143
sort_order
159
- sort_order
160
- sample_type
161
- sample_file
144
+ sample_url
162
145
}
163
146
}
164
147
}
@@ -197,12 +180,8 @@ public function testDownloadableProductQueryWithNoSample()
197
180
$ this ->assertResponseFields (
198
181
$ response ['products ' ]['items ' ][0 ]['downloadable_product_links ' ][0 ],
199
182
[
200
- 'id ' => $ downloadableProductLink ->getId (),
201
- 'is_shareable ' => false ,
202
- 'number_of_downloads ' => $ downloadableProductLink ->getNumberOfDownloads (),
203
183
'sort_order ' => $ downloadableProductLink ->getSortOrder (),
204
184
'title ' => $ downloadableProductLink ->getTitle (),
205
- 'link_type ' => strtoupper ($ downloadableProductLink ->getLinkType ()),
206
185
'price ' => $ downloadableProductLink ->getPrice ()
207
186
]
208
187
);
@@ -221,18 +200,12 @@ private function assertDownloadableProductLinks($product, $actualResponse)
221
200
/** @var LinkInterface $downloadableProductLinks */
222
201
$ downloadableProductLinks = $ product ->getExtensionAttributes ()->getDownloadableProductLinks ();
223
202
$ downloadableProductLink = $ downloadableProductLinks [1 ];
224
-
203
+ $ this -> assertNotEmpty ( ' sample_url ' , $ actualResponse [ ' downloadable_product_links ' ][ 1 ]);
225
204
$ this ->assertResponseFields (
226
205
$ actualResponse ['downloadable_product_links ' ][1 ],
227
206
[
228
- 'id ' => $ downloadableProductLink ->getId (),
229
- 'sample_url ' => $ downloadableProductLink ->getSampleUrl (),
230
- 'sample_type ' => strtoupper ($ downloadableProductLink ->getSampleType ()),
231
- 'is_shareable ' => false ,
232
- 'number_of_downloads ' => $ downloadableProductLink ->getNumberOfDownloads (),
233
207
'sort_order ' => $ downloadableProductLink ->getSortOrder (),
234
208
'title ' => $ downloadableProductLink ->getTitle (),
235
- 'link_type ' => strtoupper ($ downloadableProductLink ->getLinkType ()),
236
209
'price ' => $ downloadableProductLink ->getPrice ()
237
210
]
238
211
);
@@ -251,13 +224,12 @@ private function assertDownloadableProductSamples($product, $actualResponse)
251
224
/** @var SampleInterface $downloadableProductSamples */
252
225
$ downloadableProductSamples = $ product ->getExtensionAttributes ()->getDownloadableProductSamples ();
253
226
$ downloadableProductSample = $ downloadableProductSamples [0 ];
227
+ $ this ->assertNotEmpty ('sample_url ' , $ actualResponse ['downloadable_product_samples ' ][0 ]);
254
228
$ this ->assertResponseFields (
255
229
$ actualResponse ['downloadable_product_samples ' ][0 ],
256
230
[
257
231
'title ' => $ downloadableProductSample ->getTitle (),
258
- 'sort_order ' =>$ downloadableProductSample ->getSortOrder (),
259
- 'sample_type ' => strtoupper ($ downloadableProductSample ->getSampleType ()),
260
- 'sample_file ' => $ downloadableProductSample ->getSampleFile ()
232
+ 'sort_order ' => $ downloadableProductSample ->getSortOrder ()
261
233
]
262
234
);
263
235
}
0 commit comments