chatbox-inc / peridot-lumen-plugin by mikakane

A Peridot plugin to simplify testing Lumen applications
86
0
3
Package Data
Maintainer Username: mikakane
Maintainer Contact: mikakane2@gmail.com (mikakane)
Package Create Date: 2016-07-28
Package Last Update: 2016-07-28
Language: PHP
License: MIT
Last Refreshed: 2024-05-18 15:16:11
Package Statistics
Total Downloads: 86
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

Peridot-Lumen-Plugin

Easy to test Lumen Application with Peridot;

Usage

install via composer

$ composer require --dev chatbox-inc/peridot-lumen-plugin

and register in peridot.php file

<?php
use Evenement\EventEmitterInterface;

return function(EventEmitterInterface $emitter) {
    \Peridot\Plugin\Lumen\register(require __DIR__ . '/app.php');
};

You can use it in your spec as $this->lumen

    it('GET /string should get string ', function() {
        $this->lumen->get("/string");
        /** @var \Illuminate\Http\Response $response */
        $response = $this->lumen->response;

        assert($response->getStatusCode() === 200);
        assert($response->getOriginalContent() === "hogehoge");
    });