Skip to content

Commit 349ebec

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-60003' into 2.1-develop-pr30
2 parents bfe081b + 016720e commit 349ebec

File tree

1 file changed

+17
-2
lines changed
  • dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute

1 file changed

+17
-2
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute/Curl.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@
1717
*/
1818
class Curl extends AbstractCurl implements CatalogProductAttributeInterface
1919
{
20+
/**
21+
* Relative action path with parameters.
22+
*
23+
* @var string
24+
*/
25+
protected $urlActionPath = 'catalog/product_attribute/save/back/edit';
26+
27+
/**
28+
* Message for Exception when was received not successful response.
29+
*
30+
* @var string
31+
*/
32+
protected $responseExceptionMessage = 'Product Attribute creating by curl handler was not successful!';
33+
2034
/**
2135
* Mapping values for data.
2236
*
@@ -85,14 +99,15 @@ public function persist(FixtureInterface $fixture = null)
8599
}
86100

87101
$data = $this->changeStructureOfTheData($data);
88-
$url = $_ENV['app_backend_url'] . 'catalog/product_attribute/save/back/edit';
102+
$url = $_ENV['app_backend_url'] . $this->urlActionPath;
89103
$curl = new BackendDecorator(new CurlTransport(), $this->_configuration);
90104
$curl->write($url, $data);
91105
$response = $curl->read();
92106
$curl->close();
93107

94108
if (!strpos($response, 'data-ui-id="messages-message-success"')) {
95-
throw new \Exception("Product Attribute creating by curl handler was not successful! \n" . $response);
109+
$this->_eventManager->dispatchEvent(['curl_failed'], [$response]);
110+
throw new \Exception($this->responseExceptionMessage);
96111
}
97112

98113
$resultData = [];

0 commit comments

Comments
 (0)