Skip to content
Snippets Groups Projects
Commit 219a0364 authored by olysenko's avatar olysenko
Browse files

Merge remote-tracking branch 'origin/MAGETWO-60002' into bugfixes

parents a6ee011f adcfee77
No related merge requests found
...@@ -17,6 +17,20 @@ use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; ...@@ -17,6 +17,20 @@ use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator;
*/ */
class Curl extends AbstractCurl implements CatalogProductAttributeInterface class Curl extends AbstractCurl implements CatalogProductAttributeInterface
{ {
/**
* Relative action path with parameters.
*
* @var string
*/
protected $urlActionPath = 'catalog/product_attribute/save/back/edit';
/**
* Message for Exception when was received not successful response.
*
* @var string
*/
protected $responseExceptionMessage = 'Product Attribute creating by curl handler was not successful!';
/** /**
* Mapping values for data. * Mapping values for data.
* *
...@@ -85,14 +99,15 @@ class Curl extends AbstractCurl implements CatalogProductAttributeInterface ...@@ -85,14 +99,15 @@ class Curl extends AbstractCurl implements CatalogProductAttributeInterface
} }
$data = $this->changeStructureOfTheData($data); $data = $this->changeStructureOfTheData($data);
$url = $_ENV['app_backend_url'] . 'catalog/product_attribute/save/back/edit'; $url = $_ENV['app_backend_url'] . $this->urlActionPath;
$curl = new BackendDecorator(new CurlTransport(), $this->_configuration); $curl = new BackendDecorator(new CurlTransport(), $this->_configuration);
$curl->write($url, $data); $curl->write($url, $data);
$response = $curl->read(); $response = $curl->read();
$curl->close(); $curl->close();
if (!strpos($response, 'data-ui-id="messages-message-success"')) { if (!strpos($response, 'data-ui-id="messages-message-success"')) {
throw new \Exception("Product Attribute creating by curl handler was not successful! \n" . $response); $this->_eventManager->dispatchEvent(['curl_failed'], [$response]);
throw new \Exception($this->responseExceptionMessage);
} }
$resultData = []; $resultData = [];
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment