Cart\Cart::all PHP 메소드

all() 공개 메소드

Retrieve all of the items in the cart.
public all ( ) : cart\CartItem[]
리턴 cart\CartItem[]
    public function all()
    {
        return $this->items;
    }

Usage Example

예제 #1
0
파일: CartTest.php 프로젝트: kingsj/cart
 public function testClear()
 {
     $store = m::mock('Cart\\Storage\\Store');
     $store->shouldReceive('flush')->times(1);
     $cart = new Cart('foo', $store);
     $item1 = new CartItem(array('name' => 'foo'));
     $item2 = new CartItem(array('name' => 'bar'));
     $cart->add($item1);
     $cart->add($item2);
     $cart->clear();
     $cartItems = $cart->all();
     $this->assertTrue(count($cartItems) == 0);
 }