Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PromoQuoteForm.php
Go to the documentation of this file.
1 <?php
7 
9 use Magento\Mtf\Client\Element\SimpleElement;
10 use Magento\Mtf\Fixture\FixtureInterface;
11 
16 {
22  protected $waitForSelector = '.spinner';
23 
29  protected $waitForSelectorVisible = false;
30 
39  public function fill(FixtureInterface $fixture, SimpleElement $element = null, array $replace = null)
40  {
41  $sections = $this->getFixtureFieldsByContainers($fixture);
42  if ($replace) {
43  $sections = $this->prepareData($sections, $replace);
44  }
45  $this->fillContainers($sections, $element);
46  }
47 
55  protected function prepareData(array $sections, array $replace)
56  {
57  foreach ($replace as $sectionName => $fields) {
58  foreach ($fields as $key => $pairs) {
59  if (isset($sections[$sectionName][$key])) {
60  $sections[$sectionName][$key]['value'] = str_replace(
61  array_keys($pairs),
62  array_values($pairs),
63  $sections[$sectionName][$key]['value']
64  );
65  }
66  }
67  }
68 
69  return $sections;
70  }
71 }
$fields
Definition: details.phtml:14
fill(FixtureInterface $fixture, SimpleElement $element=null, array $replace=null)
$element
Definition: element.phtml:12