Esempio n. 1
0
 /**
  * @return mixed
  */
 public function buildAndRegister()
 {
     $this->invokeProvidersMethods();
     $fixtureId = ApiRoleHelper::create($this->_data['fixture']['attributes']);
     Builder::registerFixture(Builder::API_ROLE_FIXTURE_TYPE, $fixtureId, $this->_getHook());
     return $fixtureId;
 }
Esempio n. 2
0
 /**
  * @param Mage_Core_Model_Abstract $model
  * @param string $fixtureType
  * @param                          $entry
  * @param                          $key
  *
  * @return string
  * @throws \Exception
  */
 protected function _deleteAndUnregisterFixture(Mage_Core_Model_Abstract $model, $fixtureType, $entry, $key)
 {
     $fixture = $model->load((int) $entry);
     $fixture->delete();
     Builder::unregister($key);
     return $this->_deleteFixtureMessage($fixtureType, $entry);
 }
Esempio n. 3
0
 /**
  * @param $node
  *
  * @return array
  */
 protected function _buildManySimple($node)
 {
     $products = $this->_data['fixture'][$node]['products'];
     return FixtureBuilder::buildMany(FixtureBuilder::SIMPLE_PRODUCT_FIXTURE_TYPE, $this, $products, $this->getHook());
 }
Esempio n. 4
0
 /**
  *
  * @throws Exception
  */
 protected function _buildOauthConsumerFixture()
 {
     FixtureBuilder::build(FixtureBuilder::OAUTH_CONSUMER_FIXTURE_TYPE, new FixturesLocator(), 'oauth-consumer.yml', '@AfterSuite');
 }
Esempio n. 5
0
 /**
  * @return array
  */
 protected static function _getBuilderRegistry()
 {
     return FixtureBuilder::getRegistry();
 }
Esempio n. 6
0
 /**
  * @param array $customerRegisterData
  * @param array $customerData
  */
 protected function _setupCheckoutMethodCustomer(array $customerRegisterData, array $customerData)
 {
     if (Checkout::isCustomerCheckout($customerRegisterData)) {
         $customers = Builder::buildMany(Builder::CUSTOMER_FIXTURE_TYPE, $this, [$customerData], $this->getHook());
         if (count($customers)) {
             $this->getMageModel()->setCustomer($customers[0]);
         }
     }
 }