Skip to content

Commit 586737e

Browse files
committed
MAGETWO-90863: Error handling responses from MBI
1 parent 9c8b2e2 commit 586737e

File tree

7 files changed

+71
-3
lines changed

7 files changed

+71
-3
lines changed

app/code/Magento/Analytics/Test/Unit/Model/Connector/Http/Client/CurlTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
/**
1414
* A unit test for testing of the CURL HTTP client.
15+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1516
*/
1617
class CurlTest extends \PHPUnit\Framework\TestCase
1718
{

app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/QuoteUpdaterTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ class QuoteUpdaterTest extends \PHPUnit\Framework\TestCase
5151
*/
5252
private $quoteUpdater;
5353

54+
/**
55+
* @return void
56+
*/
5457
protected function setUp()
5558
{
5659
$this->configMock = $this->getMockBuilder(Config::class)
@@ -99,6 +102,10 @@ protected function setUp()
99102
);
100103
}
101104

105+
/**
106+
* @return void
107+
* @throws \Magento\Framework\Exception\LocalizedException
108+
*/
102109
public function testExecute()
103110
{
104111
$details = $this->getDetails();
@@ -121,6 +128,9 @@ public function testExecute()
121128
$this->quoteUpdater->execute(self::TEST_NONCE, $details, $quoteMock);
122129
}
123130

131+
/**
132+
* @return void
133+
*/
124134
private function disabledQuoteAddressValidationStep()
125135
{
126136
$this->billingAddressMock->expects(self::once())

app/code/Magento/Msrp/Test/Unit/Ui/DataProvider/Product/Listing/Collector/MsrpPriceTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ class MsrpPriceTest extends \PHPUnit\Framework\TestCase
5050
*/
5151
private $priceInfoExtensionFactory;
5252

53+
/**
54+
* @return void
55+
*/
5356
protected function setUp()
5457
{
5558
$this->priceCurrencyMock = $this->getMockBuilder(\Magento\Framework\Pricing\PriceCurrencyInterface::class)
@@ -86,6 +89,9 @@ protected function setUp()
8689
);
8790
}
8891

92+
/**
93+
* @return void
94+
*/
8995
public function testCollect()
9096
{
9197
$product = $this->getMockBuilder(Product::class)

app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Create/ReorderTest.php

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ class ReorderTest extends \PHPUnit\Framework\TestCase
108108
*/
109109
private $orderId;
110110

111+
/**
112+
* @return void
113+
*/
111114
protected function setUp()
112115
{
113116
$this->orderId = 111;
@@ -161,6 +164,9 @@ protected function setUp()
161164
);
162165
}
163166

167+
/**
168+
* @return void
169+
*/
164170
public function testExecuteForward()
165171
{
166172
$this->clearStorage();
@@ -171,6 +177,9 @@ public function testExecuteForward()
171177
$this->assertInstanceOf(Forward::class, $this->reorder->execute());
172178
}
173179

180+
/**
181+
* @return void
182+
*/
174183
public function testExecuteRedirectOrderGrid()
175184
{
176185
$this->clearStorage();
@@ -183,6 +192,9 @@ public function testExecuteRedirectOrderGrid()
183192
$this->assertInstanceOf(Redirect::class, $this->reorder->execute());
184193
}
185194

195+
/**
196+
* @return void
197+
*/
186198
public function testExecuteRedirectBack()
187199
{
188200
$this->clearStorage();
@@ -197,6 +209,9 @@ public function testExecuteRedirectBack()
197209
$this->assertInstanceOf(Redirect::class, $this->reorder->execute());
198210
}
199211

212+
/**
213+
* @return void
214+
*/
200215
public function testExecuteRedirectNewOrder()
201216
{
202217
$this->clearStorage();
@@ -211,6 +226,9 @@ public function testExecuteRedirectNewOrder()
211226
$this->assertInstanceOf(Redirect::class, $this->reorder->execute());
212227
}
213228

229+
/**
230+
* @return void
231+
*/
214232
private function clearStorage()
215233
{
216234
$this->objectManagerMock->expects($this->at(0))
@@ -220,6 +238,9 @@ private function clearStorage()
220238
$this->quoteSessionMock->expects($this->once())->method('clearStorage')->will($this->returnSelf());
221239
}
222240

241+
/**
242+
* @return void
243+
*/
223244
private function getOrder()
224245
{
225246
$this->requestMock->expects($this->once())
@@ -237,20 +258,26 @@ private function getOrder()
237258
*/
238259
private function canReorder($result)
239260
{
240-
$entity_id = 1;
241-
$this->orderMock->expects($this->once())->method('getEntityId')->willReturn($entity_id);
261+
$entityId = 1;
262+
$this->orderMock->expects($this->once())->method('getEntityId')->willReturn($entityId);
242263
$this->reorderHelperMock->expects($this->once())
243264
->method('canReorder')
244-
->with($entity_id)
265+
->with($entityId)
245266
->willReturn($result);
246267
}
247268

269+
/**
270+
* @return void
271+
*/
248272
private function prepareForward()
249273
{
250274
$this->resultForwardFactoryMock->expects($this->once())->method('create')->willReturn($this->resultForwardMock);
251275
$this->resultForwardMock->expects($this->once())->method('forward')->with('noroute')->willReturnSelf();
252276
}
253277

278+
/**
279+
* @return void
280+
*/
254281
private function createRedirect()
255282
{
256283
$this->resultRedirectFactoryMock->expects($this->once())
@@ -286,6 +313,9 @@ private function getUnavailableProducts(array $unavailableProducts)
286313
->willReturn($unavailableProducts);
287314
}
288315

316+
/**
317+
* @return void
318+
*/
289319
private function initFromOrder()
290320
{
291321
$this->orderMock->expects($this->once())->method('setReordered')->with(true)->willReturnSelf();

app/code/Magento/Sales/Test/Unit/Model/Order/ConfigTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ class ConfigTest extends \PHPUnit\Framework\TestCase
3838
*/
3939
protected $storeManagerMock;
4040

41+
/**
42+
* @return void
43+
*/
4144
protected function setUp()
4245
{
4346
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
@@ -64,6 +67,9 @@ protected function setUp()
6467
);
6568
}
6669

70+
/**
71+
* @return void
72+
*/
6773
public function testGetInvisibleOnFrontStatuses()
6874
{
6975
$statuses = [
@@ -110,6 +116,9 @@ public function testGetInvisibleOnFrontStatuses()
110116
$this->assertSame($expectedResult, $result);
111117
}
112118

119+
/**
120+
* @return void
121+
*/
113122
public function testGetStateLabelByStateAndStatus()
114123
{
115124
$statuses = [

app/code/Magento/Tax/Test/Unit/Ui/DataProvider/Product/Listing/Collector/TaxTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ class TaxTest extends \PHPUnit\Framework\TestCase
5454
*/
5555
private $formattedPriceInfoBuilder;
5656

57+
/**
58+
* @return void
59+
*/
5760
protected function setUp()
5861
{
5962
$this->priceCurrencyMock = $this->getMockBuilder(PriceCurrencyInterface::class)
@@ -88,6 +91,9 @@ protected function setUp()
8891
);
8992
}
9093

94+
/**
95+
* @return void
96+
*/
9197
public function testCollect()
9298
{
9399
$amountValue = 10;

app/code/Magento/Weee/Test/Unit/Ui/DataProvider/Product/Listing/Collector/WeeeTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class WeeeTest extends \PHPUnit\Framework\TestCase
4141
/** @var FormattedPriceInfoBuilder|\PHPUnit_Framework_MockObject_MockObject */
4242
private $formattedPriceInfoBuilder;
4343

44+
/**
45+
* @return void
46+
*/
4447
protected function setUp()
4548
{
4649
$this->weeeHelperMock = $this->getMockBuilder(\Magento\Weee\Helper\Data::class)
@@ -76,6 +79,9 @@ protected function setUp()
7679
);
7780
}
7881

82+
/**
83+
* @return void
84+
*/
7985
public function testCollect()
8086
{
8187
$productMock = $this->getMockBuilder(Product::class)

0 commit comments

Comments
 (0)