public function testProductAfterDelete() { $this->markTestIncomplete("Fix all scenarios"); $this->_setupProductObserverMock(); $mockProduct = $this->getMock('Mage_Catalog_Model_Product', array('getEntityId')); $mockProduct->expects($this->any())->method('getEntityId')->will($this->returnValue('1')); $collectionMock = $this->mockResource('catalog/product_collection', array('addFieldToFilter')); $collectionMock->expects($this->any())->method('addFieldToFilter')->will($this->returnValue(array($mockProduct))); $mockProductModel = $this->mockModel('catalog/product', array('load'), FALSE); $mockProductModel->expects($this->any())->method('load')->withAnyParameters()->will($this->returnValue($mockProduct)); $mockMessageProduct = $this->mockModel('xcom_chronicle/message_product', array('toArray'), FALSE); $mockMessageProduct->expects($this->any())->method('toArray')->will($this->returnValue(array(1))); $helperMock = $this->mockHelper('xcom_xfabric', array('send')); $helperMock->expects($this->at(0))->method('send')->with('com.x.pim.v1/ProductDeletion/ProductDeleted', array('product' => $this->_productMock)); $retObj = $this->_object->productAfterDelete($this->_observerMock); $this->assertSame($this->_object, $retObj); }