Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015 Wouter Peschier
Copyright (c) 2017 Wouter Peschier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
[![Packagist Version](https://img.shields.io/packagist/v/kielabokkie/jsonapi-behat-extension.svg?style=flat-square)](https://packagist.org/packages/kielabokkie/jsonapi-behat-extension)
[![Codacy Badge](https://img.shields.io/codacy/05bb81bdf72e4dfb8b78e76410ff7605.svg?style=flat-square)](https://www.codacy.com/app/kielabokkie/jsonapi-behat-extension)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Gitter](https://img.shields.io/badge/gitter-join%20chat-2DCD76.svg?style=flat-square)](https://gitter.im/kielabokkie/jsonapi-behat-extension)

The JSON API Behat Extension provides step definitions for common testing scenarios specific to JSON APIs. It comes with easy ways to handle authentication through OAuth.

Starting from version 2.1 this extension also has built-in support for Laravel 5.5. This means that all requests go through Laravel's request system, eliminating the use of a webserver when running your tests. Check the [Laravel setup](#laravel-setup) section for instructions on how to set this up.

## Installation

Recommended installation is by running the composer require command. This will install the latest stable version of this extension.
Expand Down Expand Up @@ -127,3 +128,15 @@ In some cases you might want to override the base url for a specific suite. Belo
- http://hooks.yourapp.dev
extensions:
Kielabokkie\BehatJsonApi: ~

## Laravel Setup

To use the Laravel specific context all you have to do is change the context class to `JsonApiLaravelContext`:

```yaml
default:
suites:
default:
contexts:
- Kielabokkie\BehatJsonApi\Context\JsonApiLaravelContext
```
4 changes: 3 additions & 1 deletion src/Context/Initializer/JsonApiInitializer.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Kielabokkie\BehatJsonApi\Context\Initializer;
<?php

namespace Kielabokkie\BehatJsonApi\Context\Initializer;

use Behat\Behat\Context\Initializer\ContextInitializer;
use Behat\Behat\Context\Context;
Expand Down
Loading