# \Thelia\Tests\ActionCartTest

## Summary

Methods
Properties
Constants
setUp()
testGetCartWithoutCustomerAndWithoutExistingCart()
testGetCartWithCustomerAndWithoutExistingCart()
testGetCartWithoutCustomerAndWithExistingCart()
testGetCartWithExistingCartButNotGoodCookies()
testGetCartWithExistingCartAndCustomer()
testGetCartWithExistingCartAndCustomerButNotSameCustomerId()
No public properties found
No constants found
No protected methods found
$session
$request
$actionCart
$uniqid
N/A
No private methods found
No private properties found
N/A

File
  Tests/Action/CartTest.php
Package
  \Default
Class hierarchy
  \PHPUnit_Framework_TestCase
  \Thelia\Tests\Action\CartTest

## Tags

None found

## Properties

### $session

    $session

#

## Tags

None found

### $request

    $request

#

## Tags

None found

### $actionCart

    $actionCart

#

## Tags

None found

### $uniqid

    $uniqid

#

## Tags

None found

## Methods

### setUp()

    setUp()

#

## Tags

None found

### 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

#

## Tags

None found

### testGetCartWithCustomerAndWithoutExistingCart()

    testGetCartWithCustomerAndWithoutExistingCart()

Customer is connected but his cart does not exists yet

Cart must be created and associated to the current connected Customer

#

## Tags

None found

### testGetCartWithoutCustomerAndWithExistingCart()

    testGetCartWithoutCustomerAndWithExistingCart()

Cart exists and his id put in cookies.

Must return the same cart instance

#

## Tags

None found

### 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)

#

## Tags

None found

### testGetCartWithExistingCartAndCustomer()

    testGetCartWithExistingCartAndCustomer()

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

cart in session must be return

#

## Tags

None found

### testGetCartWithExistingCartAndCustomerButNotSameCustomerId()

    testGetCartWithExistingCartAndCustomerButNotSameCustomerId()

Customer is connected but cart not associated to him

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

#

## Tags

None found

### CartTest.php