Download the PHP package macpaw/behat-api-context without Composer
On this page you can find all versions of the php package macpaw/behat-api-context. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package behat-api-context
Behat Api Context Bundle
Version | Build Status | Code Coverage |
---|---|---|
master |
||
develop |
Installation
Step 1: Download the Bundle
Open a command console, enter your project directory and execute:
Applications that use Symfony Flex in progress
Applications that don't use Symfony Flex
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
Step 2: Configure Behat
Go to behat.yml
:
Optional: Enable ORMContext
If you want to use ORMContext
, you need to have doctrine/orm
installed:
Then, update your behat.yml
:
Configuration
By default, the bundle has the following configuration:
ORM Installed | Default use_orm_context |
---|---|
Yes | true |
No | false |
You can override it manually in your config/packages/test/behat_api_context.yaml
:
or
depending on your needs.
Usage
Runnable request parameters
Main use case when tests need to use the current date.
Instead of static data in some .feature
file like this:
You can use dynamic expressions:
To achieve this, several conditions must be met:
- Runnable code must be a string and placed inside
<>
. - Do not add
return
keyword at the beginning, otherwise aRuntimeException
will be thrown. - Do not add
;
at the end of the expression, otherwise aRuntimeException
will be thrown. - Avoid code that returns
null
, otherwise aRuntimeException
will be thrown.
All versions of behat-api-context with dependencies
php Version ^7.4 || ^8.0
behat/behat Version ^3.0
symfony/config Version ^4.4 || ^5.4 || ^6.0 || ^7.0
symfony/dependency-injection Version ^4.4 || ^5.4.34 || ^6.0 || ^7.0.2
symfony/http-client Version ^4.4 || ^5.4 || ^6.0 || ^7.0
symfony/http-kernel Version ^4.4 || ^5.4 || ^6.0 || ^7.0
symfony/routing Version ^4.4 || ^5.4 || ^6.0 || ^7.0
macpaw/similar-arrays Version ^1.0