filisko/fake-psr3-logger
最新稳定版本:v1.1.0
Composer 安装命令:
composer require --dev filisko/fake-psr3-logger
包简介
Fake PSR-3 logger implementation for integration testing
README 文档
README
A package that provides a simple PSR-3 implementation for integration tests.
Requirements
- PHP >= 7.1
Installation
This package is installable and autoloadable via Composer as filisko/fake-psr3-logger.
composer require filisko/fake-psr3-logger --dev
Usage
This 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());
Other testing utilities
- 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.
统计信息
- 总下载量: 385
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-22