public function test_Cart_Saves_Data_To_Session() { $product = $this->getProductMock(); $mockNS = $this->getMock('Zend_Session_Namespace'); $mockNS->expects($this->any())->method('__set')->will($this->returnValue(true)); $mockNS->expects($this->any())->method('__get')->will($this->returnValue(array(1 => $product))); $this->_model = new Storefront_Model_Cart(array('sessionNs' => $mockNS)); $this->_model->addItem($product, 10); $this->assertType('array', $this->_model->getSessionNs()->items); $this->_model->removeItem($product); }