定制 krzysztofrewak/larahat 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

krzysztofrewak/larahat

Composer 安装命令:

composer require krzysztofrewak/larahat

包简介

Extremly simple Laravel Behat extension

README 文档

README

Latest Stable Version Total Downloads License

Larahat extension is an extremely simple way to start behaviour-driven development with Laravel framework and Behat.

Installation

Just use composer, it will add required classes to your vendor directory at Larahat namespace:

composer require krzysztofrewak/larahat --dev

Usage

Locate your Behat configuration file (usually it's a behat.yml) and add Larahat\BehatExtension to your extensions list. You can also provide a custom .env filename via env variable, but by default it will be always .env.behat.

default:
  extensions:
    KrzysztofRewak\Larahat\BehatExtension:
      env: ".env.behat"

From now, in your context files you are able to use app() helper for retrieving your bootstrapped Laravel application. For example, you can handle requests directly into your application like that:

/**
 * @When :method request is sent to :endpoint endpoint
 * @param string $method
 * @param string $endpoint
 */
public function requestIsSentToEndpoint(string $method, string $endpoint): void
{
    $request = Request::create($endpoint, $method);
    app()->handle($request);
}

Helpers

  • KrzysztofRewak\Larahat\Helpers\DisablingThrottling trait added to your context helps with disabling throttling middleware;
  • KrzysztofRewak\Larahat\Helpers\RefreshDatabase trait added to your context helps with refreshing database with every scenario;
  • KrzysztofRewak\Larahat\Helpers\SimpleRequesting trait added to your context helps with sending requests and receiving responses from your application.

Development

You can use Composer in a container if you want to:

docker-compose run -w /application -u "$(id -u):$(id -g)" composer install

统计信息

  • 总下载量: 1.25k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固