Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e10987ce8b | |||
| b3617954eb | |||
| 67fd7b172a | |||
| fe729453ac | |||
| b939edac3f | |||
| 00528cb7d7 |
@@ -1 +1 @@
|
|||||||
9.7.0
|
9.7.3
|
||||||
|
|||||||
@@ -15,15 +15,26 @@ use CoreLibs\Logging\Logger\MessageLevel;
|
|||||||
|
|
||||||
class ErrorMessage
|
class ErrorMessage
|
||||||
{
|
{
|
||||||
/** @var array<int,array{id:string,level:string,str:string,target:string,highlight:string[]}> */
|
/** @var array<int,array{id:string,level:string,str:string,target:string,target_style:string,highlight:string[]}> */
|
||||||
private array $error_str = [];
|
private array $error_str = [];
|
||||||
/** @var \CoreLibs\Logging\Logging $log */
|
/** @var \CoreLibs\Logging\Logging $log */
|
||||||
public \CoreLibs\Logging\Logging $log;
|
public \CoreLibs\Logging\Logging $log;
|
||||||
|
|
||||||
|
/** @var bool $log_error global flag to log error level message */
|
||||||
|
private bool $log_error = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* init ErrorMessage
|
||||||
|
*
|
||||||
|
* @param \CoreLibs\Logging\Logging $log
|
||||||
|
* @param bool $log_error [=false]
|
||||||
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
\CoreLibs\Logging\Logging $log
|
\CoreLibs\Logging\Logging $log,
|
||||||
|
bool $log_error = false
|
||||||
) {
|
) {
|
||||||
$this->log = $log;
|
$this->log = $log;
|
||||||
|
$this->log_error = $log_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,25 +52,36 @@ class ErrorMessage
|
|||||||
* not set: unkown, will be logged as "emergency"
|
* not set: unkown, will be logged as "emergency"
|
||||||
* target/highlight: id target name for frontend where to attach this message
|
* target/highlight: id target name for frontend where to attach this message
|
||||||
* highlight is a list of other target points to highlight
|
* highlight is a list of other target points to highlight
|
||||||
|
* for highlight targets css names are $level without a prefix and should be
|
||||||
|
* nested in the target element "input .error { ... }"
|
||||||
|
* target_style: if not set uses 'error-' $level as css style. applies to targets or main only
|
||||||
*
|
*
|
||||||
* @param string $error_id Any internal error ID for this error
|
* @param string $error_id Any internal error ID for this error
|
||||||
* @param string $level Error level in ok/info/warn/error
|
* @param string $level Error level in ok/info/warn/error
|
||||||
* @param string $str Error message (out)
|
* @param string $str Error message (out)
|
||||||
* @param string $target alternate attachment point for this error message
|
* @param string $target alternate attachment point for this error message
|
||||||
* @param array<string> $highlight Any additional error data as error OR
|
* @param string $target_style Alternate color style for the error message
|
||||||
* highlight points for field highlights
|
* @param array<string> $highlight Any additional error data as error OR
|
||||||
* @param string|null $message If abort/crash, non localized $str
|
* highlight points for field highlights
|
||||||
* @param array<mixed> $context Additionl info for abort/crash messages
|
* @param string|null $message If abort/crash, non localized $str
|
||||||
|
* @param array<mixed> $context Additionl info for abort/crash messages
|
||||||
|
* @param bool|null $log_error [=null] log level 'error' to error, if null use global,
|
||||||
|
* else set for this call only
|
||||||
*/
|
*/
|
||||||
public function setErrorMsg(
|
public function setErrorMsg(
|
||||||
string $error_id,
|
string $error_id,
|
||||||
string $level,
|
string $level,
|
||||||
string $str,
|
string $str,
|
||||||
string $target = '',
|
string $target = '',
|
||||||
|
string $target_style = '',
|
||||||
array $highlight = [],
|
array $highlight = [],
|
||||||
?string $message = null,
|
?string $message = null,
|
||||||
array $context = [],
|
array $context = [],
|
||||||
|
?bool $log_error = null,
|
||||||
): void {
|
): void {
|
||||||
|
if ($log_error === null) {
|
||||||
|
$log_error = $this->log_error;
|
||||||
|
}
|
||||||
$original_level = $level;
|
$original_level = $level;
|
||||||
$level = MessageLevel::fromName($level)->name;
|
$level = MessageLevel::fromName($level)->name;
|
||||||
// if not string set, write message string if set, else level/error id
|
// if not string set, write message string if set, else level/error id
|
||||||
@@ -71,10 +93,19 @@ class ErrorMessage
|
|||||||
'level' => $level,
|
'level' => $level,
|
||||||
'str' => $str,
|
'str' => $str,
|
||||||
'target' => $target,
|
'target' => $target,
|
||||||
|
'target_style' => $target_style,
|
||||||
'highlight' => $highlight,
|
'highlight' => $highlight,
|
||||||
];
|
];
|
||||||
// write to log for abort/crash
|
// write to log for abort/crash
|
||||||
switch ($level) {
|
switch ($level) {
|
||||||
|
case 'error':
|
||||||
|
if ($log_error) {
|
||||||
|
$this->log->error($message ?? $str, array_merge([
|
||||||
|
'id' => $error_id,
|
||||||
|
'level' => $original_level,
|
||||||
|
], $context));
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'abort':
|
case 'abort':
|
||||||
$this->log->critical($message ?? $str, array_merge([
|
$this->log->critical($message ?? $str, array_merge([
|
||||||
'id' => $error_id,
|
'id' => $error_id,
|
||||||
@@ -101,52 +132,40 @@ class ErrorMessage
|
|||||||
* Note, the parameter order is different and does not need an error id
|
* Note, the parameter order is different and does not need an error id
|
||||||
* This is for backend alerts
|
* This is for backend alerts
|
||||||
*
|
*
|
||||||
* @param string $level error level (ok/warn/info/error)
|
* @param string $level error level (ok/warn/info/error)
|
||||||
* @param string $str error string
|
* @param string $str error string
|
||||||
* @param string|null $error_id optional error id for precise error lookup
|
* @param string|null $error_id optional error id for precise error lookup
|
||||||
* @param string $target Alternate id name for output target on frontend
|
* @param string $target Alternate id name for output target on frontend
|
||||||
* @param array<string> $highlight Any additional error data as error OR
|
* @param string $target_style Alternate color style for the error message
|
||||||
* highlight points for field highlights
|
* @param array<string> $highlight Any additional error data as error OR
|
||||||
* @param string|null $message If abort/crash, non localized $str
|
* highlight points for field highlights
|
||||||
* @param array<mixed> $context Additionl info for abort/crash messages
|
* @param string|null $message If abort/crash, non localized $str
|
||||||
* @deprecated 9.7 Use setError instead
|
* @param array<mixed> $context Additionl info for abort/crash messages
|
||||||
|
* @param bool|null $log_error [=null] log level 'error' to error, if null use global,
|
||||||
|
* else set for this call only
|
||||||
*/
|
*/
|
||||||
public function setErrorMsgLevel(
|
public function setMessage(
|
||||||
string $level,
|
string $level,
|
||||||
string $str,
|
string $str,
|
||||||
?string $error_id = null,
|
?string $error_id = null,
|
||||||
string $target = '',
|
string $target = '',
|
||||||
|
string $target_style = '',
|
||||||
array $highlight = [],
|
array $highlight = [],
|
||||||
?string $message = null,
|
?string $message = null,
|
||||||
array $context = [],
|
array $context = [],
|
||||||
|
?bool $log_error = null,
|
||||||
): void {
|
): void {
|
||||||
$this->setErrorMsg($error_id ?? '', $level, $str, $target, $highlight, $message, $context);
|
$this->setErrorMsg(
|
||||||
}
|
$error_id ?? '',
|
||||||
|
$level,
|
||||||
/**
|
$str,
|
||||||
* pushes new error message into the error_str array
|
$target,
|
||||||
* Note, the parameter order is different and does not need an error id
|
$target_style,
|
||||||
* This is for backend alerts
|
$highlight,
|
||||||
*
|
$message,
|
||||||
* @param string $level error level (ok/warn/info/error)
|
$context,
|
||||||
* @param string $str error string
|
$log_error
|
||||||
* @param string|null $error_id optional error id for precise error lookup
|
);
|
||||||
* @param string $target Alternate id name for output target on frontend
|
|
||||||
* @param array<string> $highlight Any additional error data as error OR
|
|
||||||
* highlight points for field highlights
|
|
||||||
* @param string|null $message If abort/crash, non localized $str
|
|
||||||
* @param array<mixed> $context Additionl info for abort/crash messages
|
|
||||||
*/
|
|
||||||
public function setError(
|
|
||||||
string $level,
|
|
||||||
string $str,
|
|
||||||
?string $error_id = null,
|
|
||||||
string $target = '',
|
|
||||||
array $highlight = [],
|
|
||||||
?string $message = null,
|
|
||||||
array $context = [],
|
|
||||||
): void {
|
|
||||||
$this->setErrorMsg($error_id ?? '', $level, $str, $target, $highlight, $message, $context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// *********************************************************************
|
// *********************************************************************
|
||||||
@@ -177,7 +196,7 @@ class ErrorMessage
|
|||||||
* Gets the LAST entry in the array list.
|
* Gets the LAST entry in the array list.
|
||||||
* If nothing found returns empty array set
|
* If nothing found returns empty array set
|
||||||
*
|
*
|
||||||
* @return array{id:string,level:string,str:string,target:string,highlight:string[]} Error block
|
* @return array{id:string,level:string,str:string,target:string,target:string,highlight:string[]} Error block
|
||||||
*/
|
*/
|
||||||
public function getLastErrorMsg(): array
|
public function getLastErrorMsg(): array
|
||||||
{
|
{
|
||||||
@@ -186,9 +205,35 @@ class ErrorMessage
|
|||||||
'str' => '',
|
'str' => '',
|
||||||
'id' => '',
|
'id' => '',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_string' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// *********************************************************************
|
||||||
|
// FLAG SETTERS
|
||||||
|
// *********************************************************************
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the log error flag
|
||||||
|
*
|
||||||
|
* @param bool $flag True to log level error too, False for do not (Default)
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setFlagLogError(bool $flag): void
|
||||||
|
{
|
||||||
|
$this->log_error = $flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current log error flag
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function getFlagLogError(): bool
|
||||||
|
{
|
||||||
|
return $this->log_error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// __END__
|
// __END__
|
||||||
|
|||||||
@@ -46,6 +46,39 @@ enum MessageLevel: int
|
|||||||
{
|
{
|
||||||
return self::tryFrom($value) ?? self::unknown;
|
return self::tryFrom($value) ?? self::unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the passed $level is higher or equal to $this
|
||||||
|
*
|
||||||
|
* @param MessageLevel $level
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function includes(MessageLevel $level): bool
|
||||||
|
{
|
||||||
|
return $this->value <= $level->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If level is higher than set one
|
||||||
|
*
|
||||||
|
* @param MessageLevel $level
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isHigherThan(MessageLevel $level): bool
|
||||||
|
{
|
||||||
|
return $this->value > $level->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* if level is lower than set one
|
||||||
|
*
|
||||||
|
* @param MessageLevel $level
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isLowerThan(MessageLevel $level): bool
|
||||||
|
{
|
||||||
|
return $this->value < $level->value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// __END__
|
// __END__
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'log_level' => Level::Debug,
|
'log_level' => Level::Debug,
|
||||||
]);
|
]);
|
||||||
$em = new \CoreLibs\Logging\ErrorMessage($log);
|
$em = new \CoreLibs\Logging\ErrorMessage($log);
|
||||||
$em->setError(
|
$em->setMessage(
|
||||||
$level,
|
$level,
|
||||||
$str
|
$str
|
||||||
);
|
);
|
||||||
@@ -106,6 +106,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'str' => $str,
|
'str' => $str,
|
||||||
'id' => '',
|
'id' => '',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
],
|
],
|
||||||
$em->getLastErrorMsg()
|
$em->getLastErrorMsg()
|
||||||
@@ -139,6 +140,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'info',
|
'level' => 'info',
|
||||||
'str' => 'INFO MESSAGE',
|
'str' => 'INFO MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
],
|
],
|
||||||
$em->getLastErrorMsg()
|
$em->getLastErrorMsg()
|
||||||
@@ -154,6 +156,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'info',
|
'level' => 'info',
|
||||||
'str' => 'INFO MESSAGE',
|
'str' => 'INFO MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -171,6 +174,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'error',
|
'level' => 'error',
|
||||||
'str' => 'ERROR MESSAGE',
|
'str' => 'ERROR MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
],
|
],
|
||||||
$em->getLastErrorMsg()
|
$em->getLastErrorMsg()
|
||||||
@@ -186,6 +190,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'info',
|
'level' => 'info',
|
||||||
'str' => 'INFO MESSAGE',
|
'str' => 'INFO MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -193,6 +198,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'error',
|
'level' => 'error',
|
||||||
'str' => 'ERROR MESSAGE',
|
'str' => 'ERROR MESSAGE',
|
||||||
'target' => '',
|
'target' => '',
|
||||||
|
'target_style' => '',
|
||||||
'highlight' => [],
|
'highlight' => [],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -200,14 +206,44 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Undocumented function
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function providerErrorMessageLog(): array
|
public function providerErrorMessageLog(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
'error, not logged' => [
|
||||||
|
'id' => '200',
|
||||||
|
'level' => 'error',
|
||||||
|
'str' => 'ERROR MESSAGE',
|
||||||
|
'message' => null,
|
||||||
|
'log_error' => null,
|
||||||
|
'expected' => '<ERROR> ERROR MESSAGE',
|
||||||
|
],
|
||||||
|
'error, logged' => [
|
||||||
|
'id' => '200',
|
||||||
|
'level' => 'error',
|
||||||
|
'str' => 'ERROR MESSAGE',
|
||||||
|
'message' => null,
|
||||||
|
'log_error' => true,
|
||||||
|
'expected' => '<ERROR> ERROR MESSAGE',
|
||||||
|
],
|
||||||
|
'error, logged, message' => [
|
||||||
|
'id' => '200',
|
||||||
|
'level' => 'error',
|
||||||
|
'str' => 'ERROR MESSAGE',
|
||||||
|
'message' => 'OTHER ERROR MESSAGE',
|
||||||
|
'log_error' => true,
|
||||||
|
'expected' => '<ERROR> OTHER ERROR MESSAGE',
|
||||||
|
],
|
||||||
'crash' => [
|
'crash' => [
|
||||||
'id' => '300',
|
'id' => '300',
|
||||||
'level' => 'crash',
|
'level' => 'crash',
|
||||||
'str' => 'CRASH MESSAGE',
|
'str' => 'CRASH MESSAGE',
|
||||||
'message' => null,
|
'message' => null,
|
||||||
|
'log_error' => null,
|
||||||
'expected' => '<ALERT> CRASH MESSAGE',
|
'expected' => '<ALERT> CRASH MESSAGE',
|
||||||
],
|
],
|
||||||
'crash, message' => [
|
'crash, message' => [
|
||||||
@@ -215,6 +251,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'crash',
|
'level' => 'crash',
|
||||||
'str' => 'CRASH MESSAGE',
|
'str' => 'CRASH MESSAGE',
|
||||||
'message' => 'OTHER CRASH MESSAGE',
|
'message' => 'OTHER CRASH MESSAGE',
|
||||||
|
'log_error' => null,
|
||||||
'expected' => '<ALERT> OTHER CRASH MESSAGE',
|
'expected' => '<ALERT> OTHER CRASH MESSAGE',
|
||||||
],
|
],
|
||||||
'abort' => [
|
'abort' => [
|
||||||
@@ -222,6 +259,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'abort',
|
'level' => 'abort',
|
||||||
'str' => 'ABORT MESSAGE',
|
'str' => 'ABORT MESSAGE',
|
||||||
'message' => null,
|
'message' => null,
|
||||||
|
'log_error' => null,
|
||||||
'expected' => '<CRITICAL> ABORT MESSAGE',
|
'expected' => '<CRITICAL> ABORT MESSAGE',
|
||||||
],
|
],
|
||||||
'abort, message' => [
|
'abort, message' => [
|
||||||
@@ -229,6 +267,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'abort',
|
'level' => 'abort',
|
||||||
'str' => 'ABORT MESSAGE',
|
'str' => 'ABORT MESSAGE',
|
||||||
'message' => 'OTHER ABORT MESSAGE',
|
'message' => 'OTHER ABORT MESSAGE',
|
||||||
|
'log_error' => null,
|
||||||
'expected' => '<CRITICAL> OTHER ABORT MESSAGE',
|
'expected' => '<CRITICAL> OTHER ABORT MESSAGE',
|
||||||
],
|
],
|
||||||
'unknown' => [
|
'unknown' => [
|
||||||
@@ -236,6 +275,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'wrong level',
|
'level' => 'wrong level',
|
||||||
'str' => 'WRONG LEVEL MESSAGE',
|
'str' => 'WRONG LEVEL MESSAGE',
|
||||||
'message' => null,
|
'message' => null,
|
||||||
|
'log_error' => null,
|
||||||
'expected' => '<EMERGENCY> WRONG LEVEL MESSAGE',
|
'expected' => '<EMERGENCY> WRONG LEVEL MESSAGE',
|
||||||
],
|
],
|
||||||
'unknown, message' => [
|
'unknown, message' => [
|
||||||
@@ -243,6 +283,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
'level' => 'wrong level',
|
'level' => 'wrong level',
|
||||||
'str' => 'WRONG LEVEL MESSAGE',
|
'str' => 'WRONG LEVEL MESSAGE',
|
||||||
'message' => 'OTHER WRONG LEVEL MESSAGE',
|
'message' => 'OTHER WRONG LEVEL MESSAGE',
|
||||||
|
'log_error' => null,
|
||||||
'expected' => '<EMERGENCY> OTHER WRONG LEVEL MESSAGE',
|
'expected' => '<EMERGENCY> OTHER WRONG LEVEL MESSAGE',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
@@ -254,10 +295,22 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
* @dataProvider providerErrorMessageLog
|
* @dataProvider providerErrorMessageLog
|
||||||
* @testdox Test Log writing [$_dataName]
|
* @testdox Test Log writing [$_dataName]
|
||||||
*
|
*
|
||||||
|
* @param string $id
|
||||||
|
* @param string $level
|
||||||
|
* @param string $str
|
||||||
|
* @param string|null $message
|
||||||
|
* @param bool|null $log_error
|
||||||
|
* @param string $expected
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testErrorMessageLog(string $id, string $level, string $str, ?string $message, string $expected)
|
public function testErrorMessageLog(
|
||||||
{
|
string $id,
|
||||||
|
string $level,
|
||||||
|
string $str,
|
||||||
|
?string $message,
|
||||||
|
?bool $log_error,
|
||||||
|
string $expected
|
||||||
|
): void {
|
||||||
$log = new \CoreLibs\Logging\Logging([
|
$log = new \CoreLibs\Logging\Logging([
|
||||||
'log_file_id' => 'testErrorMessages',
|
'log_file_id' => 'testErrorMessages',
|
||||||
'log_folder' => self::LOG_FOLDER,
|
'log_folder' => self::LOG_FOLDER,
|
||||||
@@ -269,15 +322,27 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
|||||||
$id,
|
$id,
|
||||||
$level,
|
$level,
|
||||||
$str,
|
$str,
|
||||||
message: $message
|
message: $message,
|
||||||
);
|
log_error: $log_error
|
||||||
$file_content = file_get_contents(
|
|
||||||
$log->getLogFolder() . $log->getLogFile()
|
|
||||||
) ?: '';
|
|
||||||
$this->assertStringContainsString(
|
|
||||||
$expected,
|
|
||||||
$file_content
|
|
||||||
);
|
);
|
||||||
|
$file_content = '';
|
||||||
|
if (is_file($log->getLogFolder() . $log->getLogFile())) {
|
||||||
|
$file_content = file_get_contents(
|
||||||
|
$log->getLogFolder() . $log->getLogFile()
|
||||||
|
) ?: '';
|
||||||
|
}
|
||||||
|
// if n
|
||||||
|
if ($level == 'error' && ($log_error === null || $log_error === false)) {
|
||||||
|
$this->assertStringNotContainsString(
|
||||||
|
$expected,
|
||||||
|
$file_content
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->assertStringContainsString(
|
||||||
|
$expected,
|
||||||
|
$file_content
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user