heybigname/phpspec-testbench
Composer 安装命令:
composer require heybigname/phpspec-testbench
包简介
PHPSpec extension for usage with orchestra/testbench's Laravel fixture
README 文档
README
Forked to heybigname/phpspec-testbench to incorporate updated dependencies.
Overview
PHPSpec Testbench is built upon benconstable/phpspec-laravel and will bridge the gap between PHPSpec and orchestral/testbench by using the Laravel Application fixture as provided by testbench instead of having to need a fully prepared Laravel Application for yourself. With the phpspec-testbench extension, you can spec your Laravel Packages easily, whilst keeping all of the functionality that the phpspec-laravel extension brings.
Requirements
PHPSpec Testbench is built with Laravel 5 in mind and thus depends on the corresponding L5 compatible versions from phpspec-laravel and orchestral-testbench. PHPSpec Testbench does not work with Laravel 4.
Installation
Simply pull in this package via composer:
composer require pixelindustries/phpspec-testbench --dev
Usage
In your phpspec.yml file, simply add the Pixelindustries\PhpspecTestbench\LaravelExtension to the extension array:
extensions: - Pixelindustries\PhpspecTestbench\LaravelExtension
Please note that this extension should not be used in addition to the phpspec-laravel extension, but rather as a replacement.
After the above configuration, simply write your specs the way you are used to, utilizing phpspec-laravel's functionality in the process.
Custom application class
Should you need to do custom routines for the application bootstrapping, such as making sure your own developed service providers are registered, you can utilize the app_classname setting for the laravel_extension key in your phpspec.yml file:
laravel_extension: app_classname: Acme\Tests\MyCustomApp
This gives you the flexibility to implement your own routines in the getEnvironmentSetUp() method as provided by testbench. For example:
<?php namespace Acme\Tests; use Pixelindustries\PhpspecTestbench\App as TestApp; class MyCustomApp extends TestApp { protected function getEnvironmentSetUp($app) { // Custom bootstrapping } }
Please note that your custom class must extend the Pixelindustries\PhpspecTestbench\App class.
Thanks
Thanks to @BenConstable for his great work with phpspec-laravel, to @crynobone for his fantastic work with testbench, and of course a big thank you to of the other contributors and to everyone who's reported issues and bugs with these projects.
heybigname/phpspec-testbench 适用场景与选型建议
heybigname/phpspec-testbench 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 05 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 heybigname/phpspec-testbench 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 heybigname/phpspec-testbench 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-05-02