Download the PHP package friends-of-behat/test-context without Composer

On this page you can find all versions of the php package friends-of-behat/test-context. 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 test-context

Test Context License Version Scrutinizer Quality Score

Provides a reusable Behat context for testing Behat extensions. It lets you run Behat inside Behat - setting up temporary configurations, feature files, and contexts, then asserting on the results.

Installation

Configuration

Register the context in your test suite:

How It Works

Each scenario gets an isolated temporary directory that is created before and cleaned up after every scenario. When you use the setup steps, files are written into this directory. When I run Behat executes a real Behat process in that directory, and the assertion steps check its exit code and output.

This means scenarios are fully independent — file changes from one scenario never leak into another.

Usage Examples

Testing a simple extension

Quick smoke tests with shorthand steps

Asserting on error output

Available Steps

Setup

Step Description
Given a Behat configuration containing: Creates a temporary behat.yml (or behat.php for Behat 4)
Given a feature file "path" containing: Creates a feature file at the given path
Given a feature file containing: Creates a feature file with an auto-generated path
Given a context file "path" containing: Creates a PHP context file at the given path
Given a file "path" containing: Creates any file at the given path
Given a feature file with passing scenario Generates a ready-made passing scenario with context
Given a feature file with failing scenario Generates a ready-made failing scenario with context
Given a feature file with scenario with missing step Generates a scenario with an undefined step
Given a feature file with scenario with pending step Generates a scenario with a pending step

Execution

Step Description
When I run Behat Runs Behat in the temporary working directory

Assertions

Step Description
Then it should pass Asserts Behat exited with code 0
Then it should pass with "text" Asserts Behat passed and output contains text
Then it should fail Asserts Behat exited with a non-zero code
Then it should fail with "text" Asserts Behat failed and output contains text
Then it should end with "text" Asserts output contains text (regardless of exit code)

All with variants also accept multiline pystrings.


All versions of test-context with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
behat/behat Version ^3.0 || ^4.0
symfony/filesystem Version ^5.4 || ^6.4 || ^7.0 || ^8.0
symfony/process Version ^5.4 || ^6.4 || ^7.0 || ^8.0
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 friends-of-behat/test-context contains the following files

Loading the files please wait ...