restore() public method

Restore the cart from its saved state.
public restore ( )
Beispiel #1
0
 public function testRestoreExceptions()
 {
     $exceptionCounter = 0;
     $store = m::mock('Cart\\Storage\\Store');
     $store->shouldReceive('get')->times(6)->andReturn('!foo!', serialize('bar'), serialize(array('id' => 'foo')), serialize(array('items' => array())), serialize(array('id' => array(), 'items' => array())), serialize(array('items' => 'foo', 'id' => 'foo')));
     $cart = new Cart('foo', $store);
     for ($i = 1; $i <= 6; $i++) {
         try {
             $cart->restore();
         } catch (CartRestoreException $e) {
             $exceptionCounter++;
         }
     }
     $this->assertEquals($exceptionCounter, 6);
 }