Exemplo n.º 1
0
 /**
  * @magentoAppIsolation enabled
  * @magentoDbIsolation enabled
  * @magentoDataFixture Magento/Customer/_files/customer.php
  * @magentoDataFixture Magento/Customer/_files/customer_address.php
  */
 public function testSaveShippingWithData()
 {
     $data = ['address_id' => '', 'firstname' => 'Joe', 'lastname' => 'Black', 'company' => 'Lunatis', 'street' => ['1100 Parmer', 'ln.'], 'city' => 'Austin', 'region_id' => '57', 'region' => '', 'postcode' => '78757', 'country_id' => 'US', 'telephone' => '(512) 999-9999', 'fax' => '', 'save_in_address_book' => 1];
     $this->_model->saveShipping($data, null);
     $address = $this->_currentQuote->getShippingAddress();
     /* Verify that data from the form is set */
     $this->assertEquals('Joe', $address->getFirstname());
     $this->assertEquals('Black', $address->getLastname());
     $this->assertEquals('Lunatis', $address->getCompany());
     $this->assertEquals("1100 Parmer\nln.", $address->getData('street'));
     $this->assertEquals('Austin', $address->getCity());
     $this->assertEquals('US', $address->getCountryId());
     $this->assertEquals('Texas', $address->getRegion());
     $this->assertEquals('57', $address->getRegionId());
     $this->assertEquals('78757', $address->getPostcode());
     $this->assertEquals('(512) 999-9999', $address->getTelephone());
     $this->assertNull($address->getCustomerAddressId());
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function saveShipping($data, $customerAddressId)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'saveShipping');
     if (!$pluginInfo) {
         return parent::saveShipping($data, $customerAddressId);
     } else {
         return $this->___callPlugins('saveShipping', func_get_args(), $pluginInfo);
     }
 }