/** * Receives the callback from JError and logs the required error information for the test. * * @param JException $error The JException object from JError * * @return boolean To not continue with JError processing */ public static function errorCallback($error) { self::$actualError['code'] = $error->get('code'); self::$actualError['msg'] = $error->get('message'); self::$actualError['info'] = $error->get('info'); return false; }
/** * Callback receives the error from JError and deals with it appropriately * If a test expects a JError to be raised, it should call this setExpectedError first * If you don't call this method first, the test will fail. * * @param JException $error The JException object from JError * * @return JException * * @deprecated 13.1 * @since 12.1 */ public function expectedErrorCallback($error) { foreach ($this->expectedErrors as $key => $err) { $thisError = true; foreach ($err as $prop => $value) { if ($error->get($prop) !== $value) { $thisError = false; } } if ($thisError) { unset($this->expectedErrors[$key]); return $error; } } $this->fail('An unexpected error occurred - ' . $error->get('message')); return $error; }