function &write() { $args = func_get_args(); if (!$this->mock) { if ($args[0] != DEBUG_TIMING_POINT) { parent::write($args[0], $args[1], $args[2], $args[3]); } else { parent::write($args[0], $args[1]); } return; } if ($args[0] != DEBUG_TIMING_POINT) { $this->mock->_invoke('write', array($args[0], $args[1], $args[3])); $call_parent = true; foreach ($this->expected_data as $id => $data) { if ($args[0] == $data['level'] && $args[1] == $data['message'] && $args[3] == $data['params']) { $call_parent = false; break; } } if ($call_parent) { $this->test->fail('unexpected debug exception: [ ' . $args[1] . ' ]'); parent::write($args[0], $args[1], $args[2], $args[3]); } } }