本文整理汇总了PHP中Magento\Mtf\Fixture\FixtureInterface::getCustomerGroupCode方法的典型用法代码示例。如果您正苦于以下问题:PHP FixtureInterface::getCustomerGroupCode方法的具体用法?PHP FixtureInterface::getCustomerGroupCode怎么用?PHP FixtureInterface::getCustomerGroupCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Mtf\Fixture\FixtureInterface
的用法示例。
在下文中一共展示了FixtureInterface::getCustomerGroupCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: persist
/**
* POST request for creating Customer Group.
*
* @param FixtureInterface $fixture
* @return array|mixed
* @throws \Exception
*/
public function persist(FixtureInterface $fixture = null)
{
$data['code'] = $fixture->getCustomerGroupCode();
$data['tax_class'] = $fixture->getDataFieldConfig('tax_class_id')['source']->getTaxClass()->getId();
$url = $_ENV['app_backend_url'] . $this->saveUrl;
$curl = new BackendDecorator(new CurlTransport(), $this->_configuration);
$curl->addOption(CURLOPT_HEADER, 1);
$curl->write($url, $data);
$response = $curl->read();
$curl->close();
if (!strpos($response, 'data-ui-id="messages-message-success"')) {
throw new \Exception("Customer Group entity creating by curl handler was not successful! Response: {$response}");
}
return ['customer_group_id' => $this->getCustomerGroupId($data)];
}
示例2: prepareData
/**
* Prepare fixture data.
*
* @param FixtureInterface $fixture
* @return array
*/
protected function prepareData(FixtureInterface $fixture)
{
/** @var CustomerGroup $fixture */
return ['code' => $fixture->getCustomerGroupCode(), 'tax_class' => $fixture->getDataFieldConfig('tax_class_id')['source']->getTaxClass()->getId()];
}