use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
use Symfony\Component\VarDumper\Cloner\Data;
class LoggerDataCollectorTest extends TestCase
{ public function testCollectWithUnexpectedFormat() { $logger =
$this ->
getMockBuilder(DebugLoggerInterface::
class) ->
onlyMethods(['countErrors', 'getLogs', 'clear'
]) ->
getMock();
$logger->
expects($this->
once())->
method('countErrors'
)->
willReturn(123
);
$logger->
expects($this->
exactly(2
))->
method('getLogs'
)->
willReturn([]);
$c =
new LoggerDataCollector($logger, __DIR__.'/'
);
$c->
lateCollect();
$compilerLogs =
$c->
getCompilerLogs()->
getValue('message'
);
$this->
assertSame([ ['message' => 'Removed service "Psr\Container\ContainerInterface"; reason: private alias.'
],
['message' => 'Removed service "Symfony\Component\DependencyInjection\ContainerInterface"; reason: private alias.'
],
],