fix test
This commit is contained in:
parent
a9cfd4cfce
commit
e60affec5e
7 changed files with 27 additions and 10 deletions
|
@ -116,7 +116,7 @@ class Payment extends \Magento\Config\Block\System\Config\Form\Fieldset
|
|||
return $defaultValues;
|
||||
}
|
||||
|
||||
if ($response->isSuccessful()) {
|
||||
if (isset($response['paymentTypes']) && $response->isSuccessful()) {
|
||||
$paymentsTypes = $response['paymentTypes'];
|
||||
} else {
|
||||
return $defaultValues;
|
||||
|
|
|
@ -117,13 +117,17 @@ class Shipping extends \Magento\Config\Block\System\Config\Form\Fieldset
|
|||
|
||||
$values = [];
|
||||
|
||||
$response = $this->client->deliveryTypesList();
|
||||
try {
|
||||
$response = $this->client->deliveryTypesList();
|
||||
} catch (\Exception $exception) {
|
||||
return $defaultValues;
|
||||
}
|
||||
|
||||
if ($response === false) {
|
||||
return $defaultValues;
|
||||
}
|
||||
|
||||
if ($response->isSuccessful()) {
|
||||
if (isset($response['deliveryTypes']) && $response->isSuccessful()) {
|
||||
$deliveryTypes = $response['deliveryTypes'];
|
||||
} else {
|
||||
return $defaultValues;
|
||||
|
|
|
@ -109,13 +109,17 @@ class Site extends \Magento\Config\Block\System\Config\Form\Fieldset
|
|||
|
||||
$values = [];
|
||||
|
||||
$response = $this->client->sitesList();
|
||||
try {
|
||||
$response = $this->client->sitesList();
|
||||
} catch (\Exception $exception) {
|
||||
return $defaultValues;
|
||||
}
|
||||
|
||||
if ($response === false) {
|
||||
return $defaultValues;
|
||||
}
|
||||
|
||||
if ($response->isSuccessful()) {
|
||||
if (isset($response['sites']) && $response->isSuccessful()) {
|
||||
$sites = $response['sites'];
|
||||
} else {
|
||||
return $defaultValues;
|
||||
|
|
|
@ -115,13 +115,17 @@ class Sites extends \Magento\Config\Block\System\Config\Form\Fieldset
|
|||
|
||||
$values = [];
|
||||
|
||||
$response = $this->client->sitesList();
|
||||
try {
|
||||
$response = $this->client->sitesList();
|
||||
} catch (\Exception $exception) {
|
||||
return $defaultValues;
|
||||
}
|
||||
|
||||
if ($response === false) {
|
||||
return $defaultValues;
|
||||
}
|
||||
|
||||
if ($response->isSuccessful()) {
|
||||
if (isset($response['sites']) && $response->isSuccessful()) {
|
||||
$sites = $response['sites'];
|
||||
} else {
|
||||
return $defaultValues;
|
||||
|
|
|
@ -111,13 +111,17 @@ class Status extends \Magento\Config\Block\System\Config\Form\Fieldset
|
|||
|
||||
$values = [];
|
||||
|
||||
$response = $this->client->statusesList();
|
||||
try {
|
||||
$response = $this->client->statusesList();
|
||||
} catch (\Exception $exception) {
|
||||
return $defaultValues;
|
||||
}
|
||||
|
||||
if ($response === false) {
|
||||
return $defaultValues;
|
||||
}
|
||||
|
||||
if ($response->isSuccessful()) {
|
||||
if (isset($response['statuses']) && $response->isSuccessful()) {
|
||||
$statuses = $response['statuses'];
|
||||
} else {
|
||||
return $defaultValues;
|
||||
|
|
|
@ -102,7 +102,7 @@ class FieldsetTest extends TestCase
|
|||
\Magento\Config\Block\System\Config\Form::class,
|
||||
['getElements', 'getRequest']
|
||||
);
|
||||
$this->form->expects($this->any())->method('getElements')->willReturn($elementCollection);
|
||||
//$this->form->expects($this->any())->method('getElements')->willReturn($elementCollection);
|
||||
$this->form->expects($this->any())->method('getRequest')->willReturn($this->requestMock);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ class InventoriesUploadTest extends TestCase
|
|||
{
|
||||
if ($response != false) {
|
||||
$responseInventories = new \RetailCrm\Response\ApiResponse(200, json_encode($response));
|
||||
$responseInventories->asJsonResponse($response);
|
||||
|
||||
$this->mockResponse->expects($this->any())
|
||||
->method('isSuccessful')
|
||||
|
|
Loading…
Add table
Reference in a new issue