LoggerInterfaceTest
extends TestCase
in package
AbstractYes
Provides a base test class for ensuring compliance with the LoggerInterface.
Implementors can extend the class and implement abstract methods to run this as part of their test suite.
Table of Contents
Methods
- getLogger() : LoggerInterface
- getLogs() : array<string|int, string>
- This must return the log messages in order.
- provideLevelsAndMessages() : mixed
- testContextCanContainAnything() : mixed
- testContextExceptionKeyCanBeExceptionOrOtherValues() : mixed
- testContextReplacement() : mixed
- testImplements() : mixed
- testLogsAtAllLevels() : mixed
- testObjectCastToString() : mixed
- testThrowsOnInvalidLevel() : mixed
Methods
getLogger()
public
abstract getLogger() : LoggerInterface
Return values
LoggerInterfacegetLogs()
This must return the log messages in order.
public
abstract getLogs() : array<string|int, string>
The simple formatting of the messages is: "<LOG LEVEL> <MESSAGE>".
Example ->error('Foo') would yield "error Foo".
Return values
array<string|int, string>provideLevelsAndMessages()
public
provideLevelsAndMessages() : mixed
testContextCanContainAnything()
public
testContextCanContainAnything() : mixed
testContextExceptionKeyCanBeExceptionOrOtherValues()
public
testContextExceptionKeyCanBeExceptionOrOtherValues() : mixed
testContextReplacement()
public
testContextReplacement() : mixed
testImplements()
public
testImplements() : mixed
testLogsAtAllLevels()
public
testLogsAtAllLevels(mixed $level, mixed $message) : mixed
Parameters
- $level : mixed
- $message : mixed
Tags
testObjectCastToString()
public
testObjectCastToString() : mixed
testThrowsOnInvalidLevel()
public
testThrowsOnInvalidLevel() : mixed