9 use Magento\Variable\Test\Fixture\SystemVariable;
10 use Magento\Variable\Test\Page\Adminhtml\SystemVariableIndex;
11 use Magento\Variable\Test\Page\Adminhtml\SystemVariableNew;
40 SystemVariable $customVariable,
41 SystemVariableIndex $systemVariableIndex,
42 SystemVariableNew $systemVariableNew,
43 Store $storeOrigin =
null,
44 SystemVariable $customVariableOrigin =
null 47 $data = ($customVariableOrigin ===
null)
48 ? $customVariable->getData()
49 : array_merge($customVariableOrigin->getData(), $customVariable->getData());
50 if ($customVariableOrigin !==
null) {
51 $dataOrigin = $this->arrayCopy(
$data);
52 $dataOrigin[
'html_value'] = $customVariableOrigin->getHtmlValue();
53 $dataOrigin[
'plain_value'] = $customVariableOrigin->getPlainValue();
55 $dataOrigin = $this->arrayCopy(
$data);
57 if (
$data[
'html_value'] ==
'') {
58 $data[
'html_value'] = $customVariableOrigin->getHtmlValue();
59 $data[
'use_default_value'] =
'Yes';
61 $data[
'plain_value'] = (
$data[
'plain_value'] ==
'')
62 ? $customVariableOrigin->getPlainValue()
63 :
$data[
'plain_value'];
65 $systemVariableIndex->open();
66 $systemVariableIndex->getSystemVariableGrid()->searchAndOpen([
'code' =>
$data[
'code']]);
68 $formData = $systemVariableNew->getSystemVariableForm()->getData();
72 if ($storeOrigin !==
null) {
73 $systemVariableNew->getFormPageActions()->selectStoreView($storeOrigin->getName());
74 $formData = $systemVariableNew->getSystemVariableForm()->getData();
87 return 'Displayed Custom Variable data on edit page(backend) equals to passed from fixture.';
97 private function arrayCopy($sourceArray)
100 foreach ($sourceArray as $key =>
$value) {
101 $copyArray[$key] =
$value;