GithubHelp home page GithubHelp logo

behat-psr7extension's People

Contributors

asgrim avatar brunty avatar ciaranmcnulty avatar stof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

behat-psr7extension's Issues

Reboot app between steps/scenarios

Currently we're re-bootstrapping the application between steps and scenarios - it would be good to enable reuse where the app is capable of handling multiple requests

Behat suite should be covering the features of the extension

Currently, the behat suite is not covering the extension. It is an example project using the extension to cover the example-app. This has several drawbacks:

  • it does not allow you to cover error cases of the extension (as you are not asserting the behavior of the extension but using it and so an error would be a CI failure)
  • it does not give meaningful errors on failure
  • it makes it hard to test different configurations
  • it does not allow to use the scenarios as documentation (as scenarios are not describing the usage of the extension but of the example app)

I know where your setup comes from: you copied MinkExtension, which suffers from these flaws (rewriting its suite is at the bottom of my todo-list since years).
You can look at the Symfony2Extension for a suite which would run Behat inside its context instead (scenarios are not very descriptive, as they still rely on an example app rather than describing everything in the feature file, but it still solve some of the cases above)

Allow app config to be per-suite

Currently we're self-testing using repos, it would be better to allow the suite to override the app config key (especially if we think about testing sites with different combinations of middlewares active)

how to inject $app in the context?

Hello,
how is it possible to inject the app from this extension inside a custom context?

I try this to get a factory or several other

      contexts:
        - FeatureContext:
            app: '@cjm.behat.psr7.factory.slim'

thanks

Allow other implementations of HttpMessageFactoryInterface

Working on a project that uses Slim. The typehints for actions are Slim\Http\Request rather than Psr\Http\Message\RequestInterface - because this extension uses Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory it causes errors:

      Type error: Argument 1 passed to App\Action\Home::__invoke() must be an instance of Slim\Http\Request, instance of Zend\Diactoros\ServerRequest given (Behat\Testwork\Call\Exception\FatalThrowableError)

https://github.com/ciaranmcnulty/behat-psr7extension/blob/master/src/ServiceContainer/services.yml#L37

Changing the type hints in the actions isn't an option (blocker from the team lead).

How open would you be to allowing another factory to be configured to create requests for the extension? Perhaps a suggested install of https://github.com/http-interop/http-factory-slim if it is to be used, then configured so that the cjm.behat.psr7.http_message_bridge.converter service can use it?

What're your thoughts on this and do you have any preference/thoughts on how this factory switch-out should be configured?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.