ohseesoftware/laravel-queue-fake
Composer 安装命令:
composer require ohseesoftware/laravel-queue-fake
包简介
Describe your package here.
关键字:
README 文档
README
Overview
There may be times in your Laravel tests where you want to fake the Queue just for a couple lines, and then revert to the real queue after. This package makes that super simple to do:
// Given // Queue is real there // When QueueFake::wrap(function () use (&$value) { // Queue is faked inside this function }); // Queue is back to normal here
Installation
composer require ohseesoftware/laravel-queue-fake
Usage
Imagine you need to fake the queue to call your factories to setup your models, but also want to test a job:
// Given $user = null; QueueFake::wrap(function () use (&$user) { // Queue is faked inside this function $user = factory(User::class)->create(); }); // When // Queue is back to normal so we can dispatch, etc SomeJob::dispatch($user); // Then $this->assertDatabaseHas('some-table', [ 'id' => 1 ]);
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email security@ohseesoftware.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.
统计信息
- 总下载量: 180
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-17