Created
September 15, 2013 06:42
-
-
Save ScreamingDev/6568535 to your computer and use it in GitHub Desktop.
Evil eval
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function testMike() | |
| { | |
| // mock Mage_Catalog_Model_Product::save for throwing errors | |
| $alias = 'catalog/product'; | |
| $cookieMock = $this->getMock($alias, array('save')); | |
| $cookieMock->expects($this->exactly(2))->method('save')->will( | |
| $this->returnCallback(function () { | |
| throw Exception(); | |
| }) | |
| ); | |
| $this->replaceByMock('model', $alias, $cookieMock); | |
| Mage::getModel($alias)->save(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment