| 1 | <?php |
||
| 24 | class AbstractMock { |
||
| 25 | |||
| 26 | protected $callbacks = array(); |
||
| 27 | |||
| 28 | public static function init() {} |
||
| 29 | |||
| 30 | public function __construct(array $callbacks = array()) { |
||
| 31 | $this->callbacks = $callbacks; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function __call($name, array $args = array()) { |
||
| 35 | if (isset($this->callbacks[$name])) { |
||
| 36 | return call_user_func_array($this->callbacks[$name], $args); |
||
| 37 | } |
||
| 38 | return null; |
||
| 39 | } |
||
| 40 | |||
| 41 | } |
||
| 42 |