Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getProductCart example
parent::
setUp
(
)
;
$this
->ids =
new
IdsCollection
(
)
;
$this
->cartService =
$this
->
getContainer
(
)
->
get
(
CartService::
class
)
;
$this
->calculator =
$this
->
getContainer
(
)
->
get
(
QuantityPriceCalculator::
class
)
;
}
public
function
testDeliveryInformation
(
)
: void
{
$this
->
createProduct
(
)
;
$cart
=
$this
->
getProductCart
(
)
;
$lineItem
=
$cart
->
get
(
$this
->ids->
get
(
'product'
)
)
;
static
::
assertInstanceOf
(
LineItem::
class
,
$lineItem
)
;
static
::
assertInstanceOf
(
DeliveryInformation::
class
,
$lineItem
->
getDeliveryInformation
(
)
)
;
$info
=
$lineItem
->
getDeliveryInformation
(
)
;
static
::
assertEquals
(
100,
$info
->
getWeight
(
)
)
;
static
::
assertEquals
(
101,
$info
->
getHeight
(
)
)
;
static
::
assertEquals
(
102,
$info
->
getWidth
(
)
)
;
static
::
assertEquals
(
103,
$info
->
getLength
(
)
)
;
}