public function testUpdateAllOffers() { $this->markTestIncomplete("Fails"); $products = array(); $productsCnt = mt_rand(1, 20); for ($i = 0; $i < $productsCnt; $i++) { $productMock = $this->mockModel('catalog/product', array('getStoreIds'), false); $productMock->expects($this->any())->method('getStoreIds')->will($this->returnValue(array(1))); $products[] = $productMock; } $collectionMock = $this->mockResource('catalog/product_collection', array('getIterator')); $collectionMock->expects($this->any())->method('getIterator')->will($this->returnValue(new ArrayIterator($products))); $helperMock = $this->mockHelper('xcom_xfabric', array('send')); $helperMock->expects($this->exactly($productsCnt))->method('send')->with($this->equalTo('com.x.webstore.v1/WebStoreOfferUpdate/WebStoreOfferUpdated'), $this->anything()); $retObj = $this->_object->updateAllOffers(); $this->assertSame($this->_object, $retObj); }