Skip to content

Instantly share code, notes, and snippets.

@athopen
Last active August 29, 2015 14:02
Show Gist options
  • Save athopen/9a5deebfa0922f318971 to your computer and use it in GitHub Desktop.
Save athopen/9a5deebfa0922f318971 to your computer and use it in GitHub Desktop.
Mock getProcessesForReindex() in Mage_Index_Block_Adminhtml_Notifications to prevent the following Exception: Zend_Db_Select_Exception: You cannot define a correlation name 'e' more than once
/**
* Created by Andreas Penz.
* Date: 24.06.14
* Time: 17:18
*/
protected function mockNotifications()
{
$mock = $this->getBlockMock('index/adminhtml_notifications', array('getProcessesForReindex'));
$mock->expects($this->any())
->method('getProcessesForReindex')
->will($this->returnValue(array()));
$this->replaceByMock('block', 'index/adminhtml_notifications', $mock);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment