netsells/dredd-hooks-laravel
最新稳定版本:1.1.0
Composer 安装命令:
composer require netsells/dredd-hooks-laravel
包简介
Laravel hooks for the Dredd testing tool
README 文档
README
This package contains a PHP Dredd hook handler which provides a bridge between the Dredd API Testing Framework and PHP environment to ease implementation of testing hooks provided by Dredd. Most of the heavy lifting is provided by the ddelnano/dredd-hooks-php package.
It is created and maintained by the Netsells team
Installation
Composer
Laravel Hooks for Dredd should be installed via composer, we recommend you put this in your require-dev section.
composer require netsells/dredd-hooks-laravel --dev
Dredd Setup
In order to inject environment variables and use the full power of Larvel Dredd Hooks, you need to add the following to your dredd.yml file (or put in your console arguments).
# This can be any single file which extends Netsells\Dredd\Kernel hookfiles: 'tests/dredd/Kernel.php' language: 'vendor/bin/dredd-hooks-laravel' server: 'php -S 127.0.0.1:3000 ./vendor/netsells/dredd-hooks-laravel/server.php -t public/' endpoint: 'http://127.0.0.1:3000'
Usage
The package requires you to make a single file (named in the hookfiles part of dredd.yml above). This should have at least the handle method.
<?php namespace Tests\Dredd; use Netsells\Dredd\Hook; use Netsells\Dredd\Transaction; use Illuminate\Support\Facades\Artisan; use Netsells\Dredd\Kernel as DreddKernel; class Kernel extends DreddKernel { public function handle(Hook $hook) { $this->beforeEach(function (Transaction &$transaction) { Artisan::call('migrate:fresh'); Artisan::call('passport:install'); Artisan::call('db:seed'); }); $hook->group('Posts', Hooks\Posts::class); } }
netsells/dredd-hooks-laravel 适用场景与选型建议
netsells/dredd-hooks-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.47k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2018 年 02 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 netsells/dredd-hooks-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 netsells/dredd-hooks-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 13.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-21