Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setVatIds example
'amount' => 0,
]
,
'vatIdPattern' => '(DE)?[0-9]{9}',
]
;
$countryRepository
->
update
(
[
$data
]
, Context::
createDefaultContext
(
)
)
;
$country
=
$countryRepository
->
search
(
$criteria
, Context::
createDefaultContext
(
)
)
->
getEntities
(
)
->
first
(
)
;
static
::
assertNotNull
(
$country
)
;
$customer
=
new
CustomerEntity
(
)
;
$customer
->
setCompany
(
'ABC Company'
)
;
$customer
->
setVatIds
(
[
'DE123123123'
]
)
;
$context
->
expects
(
static
::
once
(
)
)
->
method
(
'getShippingLocation'
)
->
willReturn
(
ShippingLocation::
createFromCountry
(
$country
)
)
;
$context
->
expects
(
static
::
once
(
)
)
->
method
(
'getCustomer'
)
->
willReturn
(
$customer
)
;
$taxDetector
=
$this
->
getContainer
(
)
->
get
(
TaxDetector::
class
)
;