ciaranmcnulty / behat-psr7extension Goto Github PK
View Code? Open in Web Editor NEWA PSR-7 extension for Behat
License: MIT License
A PSR-7 extension for Behat
License: MIT License
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
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:
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)
If someone wants to implement this...
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)
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
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)
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.