PHPackages                             ciaranmcnulty/behat-psr7extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ciaranmcnulty/behat-psr7extension

ActiveLibrary

ciaranmcnulty/behat-psr7extension
=================================

0.1(9y ago)157.6k↓100%7[5 issues](https://github.com/ciaranmcnulty/behat-psr7extension/issues)[1 PRs](https://github.com/ciaranmcnulty/behat-psr7extension/pulls)MITPHPPHP ^7.0

Since May 6Pushed 5y agoCompare

[ Source](https://github.com/ciaranmcnulty/behat-psr7extension)[ Packagist](https://packagist.org/packages/ciaranmcnulty/behat-psr7extension)[ RSS](/packages/ciaranmcnulty-behat-psr7extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (2)Used By (0)

PSR-7 Behat Driver
==================

[](#psr-7-behat-driver)

This is a proof of concept to show that Behat can drive a PSR-7 application without going via a webserver

It's currently built by combining:

- The existing Mink Browserkit driver, that can test a Symfony app
- The existing Symfony to PSR-7 bridge, to translate requests and resources back and forth

... and integrating into a behat extension

Usage
-----

[](#usage)

Install via composer and configure your behat.yml, specifying the php file that will bootstrap the app (see below):

```
extensions:
  Cjm\Behat\Psr7Extension:
    app: %paths.base%/path/to/file.php
```

You can then also modify your MinkExtension configuration to use the PSR-7 driver, e.g.:

```
extensions:
Behat\MinkExtension:
  base_url:  'http://localhost'
  sessions:
    default:
      psr7: ~
```

Because there is no current standard interface for PSR-7-handling apps, you will need to select one of the following supported approaches.

Zend Expressive applications
----------------------------

[](#zend-expressive-applications)

Your configuration file will need to return your application file, bootstrapped. For example:

```
$container = require __DIR__ . '/../config/container.php';
return $container->get('Zend\Expressive\Application');
```

Slim applications
-----------------

[](#slim-applications)

Your configuration file will need to return your application file, bootstrapped. For example:

```
