Skip to content

Commit 33a11ef

Browse files
author
Yu Tang
committed
MAGETWO-28253: Downloadable Integration API
- Change plugin name and refactor test case per CR
1 parent 68b2a24 commit 33a11ef

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

app/code/Magento/Downloadable/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
</arguments>
6060
</type>
6161
<type name="Magento\Catalog\Model\Product">
62-
<plugin name="downloadableAfterProductLoad" type="\Magento\Downloadable\Model\Plugin\AfterProductLoad"/>
62+
<plugin name="downloadableAfterLoad" type="\Magento\Downloadable\Model\Plugin\AfterProductLoad"/>
6363
</type>
6464
<type name="Magento\Catalog\Api\ProductRepositoryInterface">
6565
<plugin name="downloadableAroundSave" type="\Magento\Downloadable\Model\Plugin\AroundProductRepositorySave"/>

dev/tests/api-functional/testsuite/Magento/Downloadable/Api/ProductRepositoryTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,14 @@ public function testCreateDownloadableProduct()
201201

202202
$expectedSampleData = $this->getExpectedSampleData();
203203
$this->assertEquals($expectedSampleData, $resultSamples);
204-
205-
return $response;
206204
}
207205

208206
/**
209207
* Update downloadable product, update a link, add two link, delete a link
210208
*/
211209
public function testUpdateDownloadableProductLinks()
212210
{
213-
$response = $this->testCreateDownloadableProduct();
211+
$response = $this->createDownloadableProduct();
214212
$resultLinks
215213
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_links"];
216214
$link1Id = $resultLinks[0]['id'];
@@ -289,7 +287,7 @@ public function testUpdateDownloadableProductLinks()
289287
*/
290288
public function testUpdateDownloadableProductLinksWithNewFile()
291289
{
292-
$response = $this->testCreateDownloadableProduct();
290+
$response = $this->createDownloadableProduct();
293291
$resultLinks
294292
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_links"];
295293
$link1Id = $resultLinks[0]['id'];
@@ -396,7 +394,7 @@ public function testUpdateDownloadableProductLinksWithNewFile()
396394

397395
public function testUpdateDownloadableProductSamples()
398396
{
399-
$response = $this->testCreateDownloadableProduct();
397+
$response = $this->createDownloadableProduct();
400398

401399
$resultSample
402400
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_samples"];
@@ -454,7 +452,7 @@ public function testUpdateDownloadableProductSamples()
454452

455453
public function testUpdateDownloadableProductSamplesWithNewFile()
456454
{
457-
$response = $this->testCreateDownloadableProduct();
455+
$response = $this->createDownloadableProduct();
458456

459457
$resultSample
460458
= $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]["downloadable_product_samples"];

0 commit comments

Comments
 (0)