This repository has been archived by the owner on Apr 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Test case observer
Vadim Justus edited this page Jun 26, 2014
·
2 revisions
The test case is designed for testing observer model classes.
The test case initiates mock objects during the setup process.
Use the method getRegisteredMock()
to get access to the mock instances.
The following list shows which key you can use and what mock you will get.
Key | Class |
---|---|
varien_observer | Varien_Event_Observer |
varien_event | Varien_Event |
Example:
$mock = $this->getRegisteredMock('some-key');
There are additional public methods provided by that test case.
/**
* @param string $key
* @param mixed $value
*/
public function addEventData($key, $value) {}
/**
* @return PHPUnit_Framework_MockObject_MockObject|Varien_Event_Observer
*/
public function getVarienObserverMock() {}
/**
* @return PHPUnit_Framework_MockObject_MockObject|Varien_Event
*/
public function getVarienEventMock() {}