Exemplo n.º 1
0
 /**
  * @return void
  */
 public function testGetIdByIso2CodeReturnsRightValue()
 {
     $country = new SpyCountry();
     $country->setIso2Code(self::ISO2_CODE);
     $country->save();
     $this->assertEquals($country->getIdCountry(), $this->countryFacade->getIdCountryByIso2Code(self::ISO2_CODE));
 }
Exemplo n.º 2
0
 /**
  * @return \Generated\Shared\Transfer\QuoteTransfer
  */
 private function getValidBaseQuoteTransfer()
 {
     $country = new SpyCountry();
     $country->setIso2Code('ix');
     $country->save();
     $quoteTransfer = new QuoteTransfer();
     $billingAddress = new AddressTransfer();
     $billingAddress->setIso2Code('ix')->setAddress1('address-1-1-test')->setFirstName('Max')->setLastName('Mustermann')->setZipCode('1337')->setCity('SpryHome');
     $shippingAddress = new AddressTransfer();
     $shippingAddress->setIso2Code('ix')->setAddress1('address-1-2-test')->setFirstName('Max')->setLastName('Mustermann')->setZipCode('1337')->setCity('SpryHome');
     $totals = new TotalsTransfer();
     $totals->setGrandTotal(1337)->setSubtotal(337);
     $quoteTransfer->setShippingAddress($shippingAddress)->setBillingAddress($billingAddress)->setTotals($totals);
     $customerTransfer = new CustomerTransfer();
     $customerTransfer->setEmail('*****@*****.**');
     $customerTransfer->setFirstName('Max');
     $customerTransfer->setLastName('Mustermann');
     $quoteTransfer->setCustomer($customerTransfer);
     $shipmentTransfer = new ShipmentTransfer();
     $shipmentTransfer->setMethod(new ShipmentMethodTransfer());
     $quoteTransfer->setShipment($shipmentTransfer);
     $itemTransfer = new ItemTransfer();
     $itemTransfer->setUnitGrossPrice(1)->setQuantity(1)->setName('test-name')->setSku('sku-test');
     $quoteTransfer->addItem($itemTransfer);
     $paymentTransfer = new PaymentTransfer();
     $paymentTransfer->setPaymentSelection('dummyPaymentInvoice');
     $quoteTransfer->setPayment($paymentTransfer);
     return $quoteTransfer;
 }
Exemplo n.º 3
0
 /**
  * @deprecated Use saveCountry() instead.
  *
  * @param string $iso2code
  * @param array $countryData
  *
  * @return int
  */
 public function createCountry($iso2code, array $countryData)
 {
     $this->checkCountryDoesNotExist($iso2code);
     $country = new SpyCountry();
     $country->setName($countryData['name'])->setPostalCodeMandatory($countryData['postal_code_mandatory'])->setPostalCodeRegex($countryData['postal_code_regex'])->setIso2Code($iso2code)->setIso3Code($countryData['iso3_code']);
     $country->save();
     return $country->getIdCountry();
 }