$logger =
$this ->
getMockBuilder(DebugLoggerInterface::
class) ->
onlyMethods(['countErrors', 'getLogs', 'clear'
]) ->
getMock();
$logger->
expects($this->
once())->
method('countErrors'
)->
willReturn(0
);
$logger->
expects($this->
exactly(2
))->
method('getLogs'
)->
willReturn([]);
$c =
new LoggerDataCollector($logger,
$containerPathPrefix);
$c->
lateCollect();
$processedLogs =
$c->
getProcessedLogs();
$this->
assertCount(1,
$processedLogs);
$this->
assertEquals($processedLogs[0
]['type'
], 'deprecation'
);
$this->
assertEquals($processedLogs[0
]['errorCount'
], 1
);
$this->
assertEquals($processedLogs[0
]['timestamp'
],
(new \
DateTimeImmutable())->
setTimestamp(filemtime($path))->
format(\DateTimeInterface::RFC3339_EXTENDED
));
$this->
assertEquals($processedLogs[0
]['priority'
], 100
);
$this->
assertEquals($processedLogs[0
]['priorityName'
], 'DEBUG'
);
$this->
assertNull($processedLogs[0
]['channel'
]);
$this->
assertInstanceOf(Data::
class,
$processedLogs[0
]['message'
]);