Download the PHP package ulff/behat-rest-api-extension without Composer

On this page you can find all versions of the php package ulff/behat-rest-api-extension. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package behat-rest-api-extension

BehatRestApiExtension

Behat context for testing REST API responses, extending MinkContext. Currently it is supporting only JSON response types. Using that extension you can make HTTP calls to your REST API and strictly check the response status codes and contents.

Setting up

Step 1: Install extension

Install extenstion using composer:

Step 2: load extension

Add following to behat.yml:

Usage

Create your own context class as an extension for base class:

You can list available scenario steps by command:

Additional steps offered by extension:

When I make request :method :uri

Make request specifying http method and uri.

Examples:

When I make request :method :uri with following JSON content:

Make request specifying http method and uri and parameters as JSON.

Examples:

When I make request :method :uri with params:

Make request specifying http method and uri and parameters as TableNode. TableNode values can be also ParameterBag params.

Examples:

Then the response should be JSON

Checks if the response is a correct JSON.

Then the response JSON should be a collection

Checks if a response JSON is a collection (array).

Then the response JSON collection should not be empty

Checks if a response JSON collection (array) is not empty.

Then the response JSON collection should be empty

Checks if a response JSON collection (array) is empty.

Then the response JSON should be a single object

Checks if a response JSON is a single object, not a collection (array).

Then the response JSON should have :property field

Checks if response JSON object has a property with given name.

Examples:

Then the response JSON should have :property field with value :expectedValue

Checks if response JSON object has a property with given name and that property has expected value.

Examples:

Then the response JSON should have :property field with null value

Checks if response JSON object has a property with given name and that property has null value.

Examples:

Then the response JSON should have :property field with exact value :expectedValue

Checks if response JSON object has a property with given name and that property has expected exact value (including type).

Examples:

Then the response JSON should have :property field with value like :expectedValueRegexp

Checks if response JSON object has a property with given name and value matching given regexp.

Examples:

Then the response JSON should have :property field set to :expectedValue

Checks if response JSON object has a property with given name and that property has expected BOOLEAN value.

Examples:

Then the response JSON should have :property field with array :expectedArray as value

When response JSON is a single object, it checks if that object has a property with given name and that property is exact array as given.

Examples:

Then all response collection items should have :property field

When response JSON is a collection (array), it checks if ALL collection items have property with given name.

Examples:

Then all response collection items should have :property field with value :expectedValue

When response JSON is a collection (array), it checks if ALL collection items have property with given name and that properties have expected value.

Examples:

Then all response collection items should have :property field with exact value :expectedValue

When response JSON is a collection (array), it checks if ALL collection items have property with given name and that properties have expected exact value (including type).

Examples:

Then all response collection items should have nested field :property with value :expectedValue

When response JSON is a collection (array), it checks if ALL collection items have nested property with given path and that properties have expected value. For nesting property use "->" inside expected property name.

Examples:

Then all response collection items should have nested field :property with exact value :expectedValue

When response JSON is a collection (array), it checks if ALL collection items have nested property with given path and that properties have expected exact value (including type). For nesting property use "->" inside expected property name.

Examples:

Then all response collection items should have :property field set to :expectedBoolean

When response JSON is a collection (array), it checks if ALL collection items have property with given name and that properties have expected BOOLEAN value.

Examples:

Then the response JSON :fieldName field should be a collection

When response JSON is a single object, it checks if that object has a property with given name and if that property is a collection (array).

Examples:

Then all nested :collectionFieldName collection items should have :nestedFieldName field

When response JSON is a single object, it checks if that object has a property with given name, and that property is a collection (array), and all of that collection items have nested field with given path.

Examples:

Then all nested :collectionFieldName collection items should have :nestedFieldName field set to :expectedValue

When response JSON is a single object, it checks if that object has a property with given name, and that property is a collection (array), and all of that collection items have nested field with given path and given BOOLEAN value.

Examples:

Then all nested :collectionFieldName collection items should have :nestedFieldName field with value :expectedValue

When response JSON is a single object, it checks if that object has a property with given name, and that property is a collection (array), and all of that collection items have nested field with given path and with given value.

Examples:

Then all nested :collectionFieldName collection items should have :nestedFieldName field with exact value :expectedValue

When response JSON is a single object, it checks if that object has a property with given name, and that property is a collection (array), and all of that collection items have nested field with given path and with given exact value (including type).

Examples:

Then all nested :collectionFieldName collection items should have nested :nestedFieldName field with value :expectedValue

When response JSON is a single object, it checks if that object has a property with given name, and that property is a collection (array), and all of that collection items have nested field with given path and given value. For nesting property use "->" inside expected property name.

Examples:

Then all nested :collectionFieldName collection items should have nested :nestedFieldName field with exact value :expectedValue

When response JSON is a single object, it checks if that object has a property with given name, and that property is a collection (array), and all of that collection items have nested field with given path and given exact value (including type). For nesting property use "->" inside expected property name.

Examples:

Then exactly one nested :collectionFieldName collection items should have :nestedFieldName field with value :expectedValue

When response JSON is a single object, it checks if that object has a property with given name, and that property is a collection (array), and exactly one of that collection items have nested field with given path and with given value.

Examples:

Then at least one nested :collectionFieldName collection items should have :nestedFieldName field with value :expectedValue

When response JSON is a single object, it checks if that object has a property with given name, and that property is a collection (array), and at least one of that collection items have nested field with given path and with given value.

Examples:

Then the response JSON should have nested :nestedFieldName field with value :expectedValue

When response JSON is a single object, it checks if that object has a property with given path and given value. For nesting property use "->" inside expected property name.

Examples:

Then the response JSON should have nested :nestedFieldName field with null value

When response JSON is a single object, it checks if that object has a property with given path with null value. For nesting property use "->" inside expected property name.

Examples:

Then the response collection should count :expectedValue items

When response JSON is a collection (array), it checks the number of items in collection.

Examples:

Then at least one of the collection items should have field :fieldName with value :expectedValue

When response JSON is a collection (array), it checks if any collection item has field with given value.

Examples:


All versions of behat-rest-api-extension with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
behat/behat Version ^3.1
behat/mink Version ^1.7
behat/mink-extension Version ^2.2
behat/symfony2-extension Version ^2.1
codifico/parameter-bag-extension Version dev-master
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ulff/behat-rest-api-extension contains the following files

Loading the files please wait ....