Documentation

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

getLogs()

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>

testContextExceptionKeyCanBeExceptionOrOtherValues()

public testContextExceptionKeyCanBeExceptionOrOtherValues() : mixed

testLogsAtAllLevels()

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

provideLevelsAndMessages

testThrowsOnInvalidLevel()

public testThrowsOnInvalidLevel() : mixed
Tags
expectedException

\Psr\Log\InvalidArgumentException


        
On this page

Search results