本文整理汇总了PHP中Magento\Mtf\Fixture\FixtureInterface::getCode方法的典型用法代码示例。如果您正苦于以下问题:PHP FixtureInterface::getCode方法的具体用法?PHP FixtureInterface::getCode怎么用?PHP FixtureInterface::getCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Mtf\Fixture\FixtureInterface
的用法示例。
在下文中一共展示了FixtureInterface::getCode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fill
/**
* Fill the root form
*
* @param FixtureInterface $fixture
* @param SimpleElement|null $element
* @return $this
*/
public function fill(FixtureInterface $fixture, SimpleElement $element = null)
{
$element = $this->_rootElement->find(sprintf($this->currencyRow, $fixture->getCode()), Locator::SELECTOR_XPATH);
$data = $fixture->getData();
unset($data['code']);
$mapping = $this->dataMapping($data);
$this->_fill($mapping, $element);
return $this;
}
示例2: persist
/**
* Post request for creating widget instance.
*
* @param FixtureInterface $fixture [optional]
* @throws \Exception
* @return array
*/
public function persist(FixtureInterface $fixture = null)
{
$code = $this->mappingData['code'][$fixture->getCode()];
$themeId = $this->getThemeId($fixture->getThemeId());
$data = $this->prepareData($fixture);
$url = $_ENV['app_backend_url'] . 'admin/widget_instance/save/code/' . $code . '/theme_id/' . $themeId;
$curl = new BackendDecorator(new CurlTransport(), $this->_configuration);
$curl->write($url, $data);
$response = $curl->read();
$curl->close();
if (!strpos($response, 'data-ui-id="messages-message-success"')) {
throw new \Exception("Widget instance creation by curl handler was not successful! Response: {$response}");
}
$id = null;
if (preg_match_all('/\\/widget_instance\\/edit\\/instance_id\\/(\\d+)/', $response, $matches)) {
$id = $matches[1][count($matches[1]) - 1];
}
return ['id' => $id];
}
示例3: fill
/**
* Fill the root form
*
* @param FixtureInterface $fixture
* @param SimpleElement|null $element
* @return $this
*/
public function fill(FixtureInterface $fixture, SimpleElement $element = null)
{
$element = $this->_rootElement->find(sprintf($this->currencyRow, $fixture->getCode()), Locator::SELECTOR_XPATH);
return parent::fill($fixture, $element);
}