Skip to content

Commit 9c8b2e2

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

File tree

9 files changed

+38
-4
lines changed

9 files changed

+38
-4
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ public function getTestData()
104104
}
105105

106106
/**
107+
* @param array $data
107108
* @return void
109+
* @throws \Zend_Http_Exception
108110
* @dataProvider getTestData
109111
*/
110112
public function testRequestSuccess(array $data)
@@ -145,7 +147,9 @@ public function testRequestSuccess(array $data)
145147
}
146148

147149
/**
150+
* @param array $data
148151
* @return void
152+
* @throws \Zend_Http_Exception
149153
* @dataProvider getTestData
150154
*/
151155
public function testRequestError(array $data)

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class JsonConverterTest extends \PHPUnit\Framework\TestCase
2525
*/
2626
private $converter;
2727

28+
/**
29+
* @return void
30+
*/
2831
protected function setUp()
2932
{
3033
$this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
@@ -37,6 +40,9 @@ protected function setUp()
3740
);
3841
}
3942

43+
/**
44+
* @return void
45+
*/
4046
public function testConverterContainsHeader()
4147
{
4248
$this->assertEquals(
@@ -69,6 +75,9 @@ public function convertBodyDataProvider()
6975
];
7076
}
7177

78+
/**
79+
* return void
80+
*/
7281
public function testConvertData()
7382
{
7483
$this->serializerMock->expects($this->once())

app/code/Magento/Analytics/Test/Unit/Model/Connector/SignUpCommandTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class SignUpCommandTest extends \PHPUnit\Framework\TestCase
5757
*/
5858
private $responseResolverMock;
5959

60+
/**
61+
* @return void
62+
*/
6063
protected function setUp()
6164
{
6265
$this->analyticsTokenMock = $this->getMockBuilder(AnalyticsToken::class)
@@ -91,6 +94,10 @@ protected function setUp()
9194
);
9295
}
9396

97+
/**
98+
* @throws \Zend_Http_Exception
99+
* @return void
100+
*/
94101
public function testExecuteSuccess()
95102
{
96103
$this->integrationManagerMock->expects($this->once())
@@ -124,6 +131,9 @@ public function testExecuteSuccess()
124131
$this->assertTrue($this->signUpCommand->execute());
125132
}
126133

134+
/**
135+
* @return void
136+
*/
127137
public function testExecuteFailureCannotGenerateToken()
128138
{
129139
$this->integrationManagerMock->expects($this->once())
@@ -134,6 +144,10 @@ public function testExecuteFailureCannotGenerateToken()
134144
$this->assertFalse($this->signUpCommand->execute());
135145
}
136146

147+
/**
148+
* @throws \Zend_Http_Exception
149+
* @return void
150+
*/
137151
public function testExecuteFailureResponseIsEmpty()
138152
{
139153
$this->integrationManagerMock->expects($this->once())

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ private function getQuoteMock()
300300
$cartExtensionMock = $this->getMockBuilder(CartExtensionInterface::class)
301301
->setMethods(['setShippingAssignments'])
302302
->disableOriginalConstructor()
303-
->getMock();
303+
->getMockForAbstractClass();
304304

305305
$quoteMock->expects(self::any())
306306
->method('getExtensionAttributes')

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function testCollect()
101101
\Magento\Catalog\Api\Data\ProductRender\PriceInfoExtensionInterface::class
102102
)
103103
->setMethods(['setMsrp'])
104-
->getMock();
104+
->getMockForAbstractClass();
105105

106106
$priceInfo = $this->getMockBuilder(MsrpPriceInfoInterface::class)
107107
->setMethods(['getPrice', 'getExtensionAttributes'])

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ protected function setUp()
118118
->getMock();
119119
$this->requestMock = $this->getMockBuilder(RequestInterface::class)->getMockForAbstractClass();
120120
$this->objectManagerMock = $this->getMockBuilder(ObjectManagerInterface::class)->getMockForAbstractClass();
121-
$this->resultForwardFactoryMock = $this->getMockBuilder(ForwardFactory::class)->getMock();
121+
$this->resultForwardFactoryMock = $this->getMockBuilder(ForwardFactory::class)
122+
->disableOriginalConstructor()
123+
->getMock();
122124
$this->resultRedirectFactoryMock = $this->getMockBuilder(RedirectFactory::class)
123125
->disableOriginalConstructor()
124126
->getMock();

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ protected function setUp()
4747
'storeManager' => $this->storeManagerMock,
4848
]);
4949
$this->statusFactoryMock = $this->getMockBuilder(\Magento\Sales\Model\Order\StatusFactory::class)
50+
->disableOriginalConstructor()
5051
->setMethods(['load', 'create'])
5152
->getMock();
5253
$this->orderStatusCollectionFactoryMock = $this->createPartialMock(

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ protected function setUp()
6868
->getMockForAbstractClass();
6969

7070
$this->priceInfoFactory = $this->getMockBuilder(PriceInfoInterfaceFactory::class)
71+
->disableOriginalConstructor()
7172
->setMethods(['create'])
7273
->getMock();
7374

7475
$this->priceInfoExtensionFactory = $this->getMockBuilder(PriceInfoExtensionInterfaceFactory::class)
76+
->disableOriginalConstructor()
7577
->setMethods(['create'])
7678
->getMock();
7779
$this->formattedPriceInfoBuilder = $this->getMockBuilder(FormattedPriceInfoBuilder::class)

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,16 @@ protected function setUp()
5050
->getMockForAbstractClass();
5151

5252
$this->weeeAdjustmentAttributeFactory = $this->getMockBuilder(WeeeAdjustmentAttributeInterfaceFactory::class)
53+
->disableOriginalConstructor()
5354
->setMethods(['create'])
5455
->getMock();
5556

5657
$this->extensionAttributes = $this->getMockBuilder(PriceInfoExtensionInterface::class)
5758
->setMethods(['setWeeeAttributes', 'setWeeeAdjustment'])
58-
->getMock();
59+
->getMockForAbstractClass();
5960

6061
$this->priceInfoExtensionFactory = $this->getMockBuilder(PriceInfoExtensionInterfaceFactory::class)
62+
->disableOriginalConstructor()
6163
->setMethods(['create'])
6264
->getMock();
6365

0 commit comments

Comments
 (0)