A package that provides a simple PSR-3 implementation for integration tests.
- PHP >= 7.1
This package is installable and autoloadable via Composer as filisko/fake-psr3-logger.
composer require filisko/fake-psr3-logger --devThis package provides a PSR-3 (Psr\Log\LoggerInterface) implementation that allows you to verify the logging your code has made.
use Filisko\FakeLogger;
// PHP Unit scenario
$logger = new FakeLogger();
$logger->info('Something interesting happened', [
'user_id' => 1
]);
// logs exposed
$logs = $logger->logs();
$this->assertSame([
[
'level' => 'info',
'message' => 'Something interesting happened',
'context' => [
'user_id' => 1,
],
]
], $logs);
$this->assertSame(1, $logger->count());- PSR-16 fake cache: kodus/mock-cache
- PSR-15 middleware dispatcher: middlewares/utils (used in conjuction with PSR-7 and PSR-17)
- Testable PHP functions: filisko/testable-phpfunctions
Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.