Esempio n. 1
0
 /**
  * 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;
 }
Esempio n. 2
0
 /**
  * @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;
     }
 }
Esempio n. 3
0
 /**
  * @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();
 }
Esempio n. 4
0
 /**
  * @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();
 }
Esempio n. 5
0
 /**
  * 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');
     }
 }
Esempio n. 6
0
 /**
  * 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');
 }
Esempio n. 7
0
 /**
  * @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');
 }
Esempio n. 8
0
 /**
  * @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;
 }