Properties

$session

$session

$request

$request

$actionCart

$actionCart

$uniqid

$uniqid

Methods

setUp()

setUp()

testGetCartWithoutCustomerAndWithoutExistingCart()

testGetCartWithoutCustomerAndWithoutExistingCart()

no cart present in session and cart_id no yet exists in cookies.

In this case, a new cart instance must be create

testGetCartWithCustomerAndWithoutExistingCart()

testGetCartWithCustomerAndWithoutExistingCart()

Customer is connected but his cart does not exists yet

Cart must be created and associated to the current connected Customer

testGetCartWithoutCustomerAndWithExistingCart()

testGetCartWithoutCustomerAndWithExistingCart()

Cart exists and his id put in cookies.

Must return the same cart instance

testGetCartWithExistingCartButNotGoodCookies()

testGetCartWithExistingCartButNotGoodCookies()

a cart id exists in cookies but this id does not exists yet in databases

a new cart must be created (different token)

testGetCartWithExistingCartAndCustomer()

testGetCartWithExistingCartAndCustomer()

cart and customer already exists. Cart and customer are linked.

cart in session must be return

testGetCartWithExistingCartAndCustomerButNotSameCustomerId()

testGetCartWithExistingCartAndCustomerButNotSameCustomerId()

Customer is connected but cart not associated to him

A new cart must be created (duplicated) containing customer id