Example #1
0
 public function testGetSubTotals()
 {
     // prepare sub-collection
     $subCollection = new Varien_Data_Collection();
     $subCollection->addItem(new Varien_Object(array('column' => '1')));
     $subCollection->addItem(new Varien_Object(array('column' => '1')));
     $this->_subtotalsMock->expects($this->once())->method('countTotals')->with($subCollection)->will($this->returnValue(new Varien_Object(array('column' => '2'))));
     // prepare item
     $item = new Varien_Object(array('test1' => '1'));
     $item->setChildren($subCollection);
     $this->assertEquals(new Varien_Object(array('column' => '2')), $this->_block->getSubTotals($item));
 }