Documentation

LoggerInterfaceTest extends TestCase
in package

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

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

getLogs()

This must return the log messages in order.

public abstract getLogs() : array<string|int, string>

The simple formatting of the messages is: " ".

Example ->error('Foo') would yield "error Foo".

Return values
array<string|int, string>

provideLevelsAndMessages()

public provideLevelsAndMessages() : mixed
Return values
mixed

testContextCanContainAnything()

public testContextCanContainAnything() : mixed
Return values
mixed

testContextExceptionKeyCanBeExceptionOrOtherValues()

public testContextExceptionKeyCanBeExceptionOrOtherValues() : mixed
Return values
mixed

testContextReplacement()

public testContextReplacement() : mixed
Return values
mixed

testLogsAtAllLevels()

public testLogsAtAllLevels(mixed $level, mixed $message) : mixed
Parameters
$level : mixed
$message : mixed
Tags
dataProvider

provideLevelsAndMessages

Return values
mixed

testObjectCastToString()

public testObjectCastToString() : mixed
Return values
mixed

testThrowsOnInvalidLevel()

public testThrowsOnInvalidLevel() : mixed
Tags
expectedException

\Psr\Log\InvalidArgumentException

Return values
mixed

Search results