Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CouponCode.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Mtf\Fixture\FixtureFactory;
11 use Magento\Mtf\Fixture\DataSource;
12 
16 class CouponCode extends DataSource
17 {
24  public function __construct(FixtureFactory $fixtureFactory, array $data, array $params = [])
25  {
26  $this->params = $params;
27  if (isset($data['value']) && $data['value'] instanceof SalesRule) {
28  $this->data = $data['value'];
29  return;
30  }
31  if (isset($data['dataset'])) {
32  $salesRule = $fixtureFactory->createByCode('salesRule', ['dataset' => $data['dataset']]);
33  $salesRule->persist();
34  $this->data = $salesRule;
35  }
36  }
37 }
__construct(FixtureFactory $fixtureFactory, array $data, array $params=[])
Definition: CouponCode.php:24
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18