/** * Switch current data set * * @param $name * @return bool */ public function switchData($name) { $result = $this->_addressFixture->switchData($name); if (!$result) { return false; } $data = $this->_addressFixture->getData(); $this->_data = array('fields' => array('address_id' => array('value' => $data['fields']['firstname']['value'] . ' ' . $data['fields']['lastname']['value'] . ', ' . $data['fields']['street']['value'] . ', ' . $data['fields']['city']['value'] . ', ' . $data['fields']['region_id']['value'] . ' ' . $data['fields']['postcode']['value'] . ', ' . $data['fields']['country_id']['value'], 'input' => 'select'))); return $result; }
/** * @return void */ public function next() { $data = next($this->_repository); if (false !== $data) { $this->_key = key($this->_repository); // check config and ignore if data set is not matched to current test mode $this->_current = clone $this->_fixture; $this->_current->setData($data['data'], $data['config']); } else { $this->_key = null; } }
/** * @param Config $configuration * @param array $placeholders */ public function __construct(Config $configuration, array $placeholders = array()) { parent::__construct($configuration, $placeholders); $this->_placeholders['rewritten_category_request_path'] = array($this, 'getRewrittenRequestPath'); $this->_repository = Factory::getRepositoryFactory()->getMagentoUrlRewriteUrlRewriteCategory($this->_dataConfig, $this->_data); $this->category = Factory::getFixtureFactory()->getMagentoCatalogCategory(); $this->category->persist(); }
/** * @param Config $configuration * @param array $placeholders */ public function __construct(Config $configuration, $placeholders = array()) { parent::__construct($configuration, $placeholders); $this->_placeholders['rewritten_product_request_path'] = array($this, 'getRewrittenRequestPath'); $this->_repository = Factory::getRepositoryFactory()->getMagentoUrlRewriteUrlRewriteProduct($this->_dataConfig, $this->_data); $this->product = Factory::getFixtureFactory()->getMagentoCatalogSimpleProduct(); $this->product->switchData('simple'); $this->product->persist(); }
/** * Custom constructor to create product with assigned category * * @param Config $configuration * @param array $placeholders */ public function __construct(Config $configuration, $placeholders = array()) { parent::__construct($configuration, $placeholders); if (isset($placeholders['categories'])) { $this->categories = $placeholders['categories']; } else { $this->_placeholders['category::getCategoryName'] = array($this, 'categoryProvider'); $this->_placeholders['category::getCategoryId'] = array($this, 'categoryProvider'); } }
/** * Custom constructor to create category with custom parent category * * @param Config $configuration * @param array $placeholders */ public function __construct(Config $configuration, $placeholders = array()) { parent::__construct($configuration, $placeholders); $this->_placeholders['men::getCategoryName'] = array($this, '_categoryProvider'); $this->_placeholders['men::getCategoryId'] = array($this, '_categoryProvider'); }
/** * @param Config $configuration * @param array $placeholders */ public function __construct(Config $configuration, $placeholders = array()) { $placeholders['password'] = isset($placeholders['password']) ? $placeholders['password'] : '******'; parent::__construct($configuration, $placeholders); $this->_placeholders['sales_all_scopes'] = array($this, 'roleProvider'); }
/** * @param \Mtf\System\Config $configuration * @param array $placeholders */ public function __construct(\Mtf\System\Config $configuration, array $placeholders = array()) { parent::__construct($configuration, $placeholders); $this->_placeholders = $placeholders; }