9 use Magento\Mtf\Config\DataInterface;
10 use Magento\Mtf\Util\Protocol\CurlInterface;
67 $url = $_ENV[
'app_backend_url'];
68 $this->transport->write(
$url, [], CurlInterface::GET);
71 $url = $_ENV[
'app_backend_url'] . $this->configuration->get(
'application/0/backendLoginUrl/0/value');
73 'login[username]' => $this->configuration->get(
'application/0/backendLogin/0/value'),
74 'login[password]' => $this->configuration->get(
'application/0/backendPassword/0/value'),
77 $this->transport->write(
$url,
$data, CurlInterface::POST);
79 if (strpos(
$response,
'login-form') !==
false) {
81 'Admin user cannot be logged in by curl handler!' 93 preg_match(
'!var FORM_KEY = \'(\w+)\';!', $this->response, $matches);
94 if (!empty($matches[1])) {
95 $this->formKey = $matches[1];
111 if ($this->formKey) {
114 throw new \Exception(sprintf(
'Form key is absent! Url: "%s" Response: "%s"',
$url, $this->response));
126 $this->response = $this->transport->read();
150 $this->transport->close();
write($url, $params=[], $method=CurlInterface::POST, $headers=[])
__construct(CurlTransport $transport, DataInterface $configuration)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
addOption($option, $value)