kielabokkie / jsonapi-behat-extension Goto Github PK
View Code? Open in Web Editor NEWExtension for Behat to test RESTful JSON APIs with support for OAuth
License: MIT License
Extension for Behat to test RESTful JSON APIs with support for OAuth
License: MIT License
I need to be able to specify at run time which client credentials I would like to OAuth with.
Use case:
I have more than one OAuth grant and have different test "clients" for each grant
Many PHP OAuth clients require a request body in x-www-form-urlencoded
type. In the case of sendOauthRequest()
request is sent with json_encode
and application/json
Content-Type. I fixed this issue and will provide the PR.
We are currently locked on kriswallsmith/buzz 0.15.2
but this does not support PHP 8. We will have to update to the stable v1.x version.
This has a drawback though: buzz 1.x no longer supports PHP 5, so in case we update we will have to drop PHP 5 support as well, or find a solution around it.
Hi there,
I am just setting up a new project on Laravel 5.4 and have pulled in your package as one of my first steps in setting up the project.
When I run vendor/bin/behat
I get the following error
[Behat\Testwork\ServiceContainer\Exception\ExtensionInitializationException]
`Kielabokkie\BehatJsonApi` extension file or class could not be located.
I tried composer dump
and php artisan cache:clear
(for good measure) but no luck
However running composer dump -o
does fix the issue. Not sure what is causing the bug but it seems strange that the optimised auto-loader is all that fixes it.
The Nyholm\Psr7\Response does not have a getConntent method!!!
This is a show stopper.
Oauth and response validation are broken.
sendOauthRequest:
protected function sendOauthRequest(array $payload)
{
$url = sprintf('%s%s', $this->baseUrl, $this->parameters['oauth']['uri']);
$response = $this->client->post($url, $this->headers, json_encode($payload));
**$responseContent = json_decode($response->getContent());**
public function iGetAResponse($statusCode)
{
$response = $this->getResponse();
$contentType = $response->getHeader('Content-Type');
**$bodyOutput = $response->getContent();**
And many other places to fix..
Newer versions of PHPUnit do not support assertInternalType()
, we should use assertIs{type}()
instead. I'll provide PR.
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.