File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductAttribute Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 17
17
*/
18
18
class Curl extends AbstractCurl implements CatalogProductAttributeInterface
19
19
{
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
+
20
34
/**
21
35
* Mapping values for data.
22
36
*
@@ -85,14 +99,15 @@ public function persist(FixtureInterface $fixture = null)
85
99
}
86
100
87
101
$ data = $ this ->changeStructureOfTheData ($ data );
88
- $ url = $ _ENV ['app_backend_url ' ] . ' catalog/product_attribute/save/back/edit ' ;
102
+ $ url = $ _ENV ['app_backend_url ' ] . $ this -> urlActionPath ;
89
103
$ curl = new BackendDecorator (new CurlTransport (), $ this ->_configuration );
90
104
$ curl ->write ($ url , $ data );
91
105
$ response = $ curl ->read ();
92
106
$ curl ->close ();
93
107
94
108
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 );
96
111
}
97
112
98
113
$ resultData = [];
You can’t perform that action at this time.
0 commit comments