frankperez87/laravel-log-fake
最新稳定版本:0.2.2
Composer 安装命令:
composer require frankperez87/laravel-log-fake
包简介
Enables you to test the Laravel Logger.
README 文档
README
This package allows you to easily test the Laravel Log functionality.
Supported Versions
We currently support the following Laravel versions.
| Version | Supported |
|---|---|
| 8.x | ✅ |
| 9.x | ✅ |
Installation
You can install the package via composer:
composer require frankperez87/laravel-log-fake
Usage
use frankperez87\LaravelLogFake\Facades\Log; Log::fake(); logger()->withContext([ 'yay' => 'it works', ]); logger()->info('this is a info log'); # You can use the helpers via the Facade Log::assertContext(function ($context) { return $context == ['yay' => 'it works']; }); Log::assertLogged(function ($log) { return $log['level'] == 'emergency' && $log['message'] == 'this is a emergency log'; }); # You can also use the helper instead logger()->assertContext(function ($context) { return $context == ['yay' => 'it works']; }); logger()->assertLogged(function ($log) { return $log['level'] == 'emergency' && $log['message'] == 'this is a emergency log'; });
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-22