Download the PHP package edmondscommerce/behat-db-context without Composer

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

Behat DB Context

By Edmonds Commerce

A Behat context for managing your testing database.

Installation

Install via composer

"edmondscommerce/behat-db-context": "dev-master@dev"

Include Context in Behat Configuration

Features

Ensures You're Using the Testing Database

The context employs platform detection to ensure that your application is currently using the test database you configured in behat.yml using databaseName.

If you're not using the correct database then you'll receive an exception and the tests won't proceed.

To add support for you're platform you can follow the steps detailed below in the 'Adding Support For New Platforms' section.

Import Fresh Testing Database

The context imports a fresh version of the testing database each time you run your test suite. It imports the SQL dump configured in your behat.yml using pathToSqlDump and imports this into the database databaseName.

NOTE: this context assumes you have your MYSQL credentials configured in .my.cnf.

Optional Testing Database Import

When importTestingDatabase is set to false the import step will be skipped. This is useful while working on the tests locally but should always be set to true when finally running the test suite.

Even when this is set to false the check to confirm you're using the correct database and your custom assertions (see below) will still be run to ensure everything is configured correctly.

Custom Assertions

In order to flexibly confirm the database is in the correct state the context supports custom assertions. These are simple COUNT SQL queries which need to return 1 in order to pass. You can provide as many of these as you like.

For example:

Adding Support For New Platforms

All platform code is contained within the Platform class. In order to extend this you need to provide two functions; one which handles platform detection and one which handles database detection.

Platform Detection

Add Detection Method

You need to add a method that can detect the platform from the project root. The Magento platform detection simply does this by looking for local.xml:

Add Method to Detect

You then need to add this to the detect method:

And add your platform as a constant:

Database Detection

Now that you have platform detection in place you need to handle database configuration detection.

Add Assertion Method

You need to add a method that can assert that the platforms database is currently configured to use the testing database. If the platform isn't configured correctly it should throw an exception.

Here's the Magento 1 assertion for example:

Add Method to Assert

You then need to add this platform specific assertion to the generic assertion method:

Your platform is now supported!


All versions of behat-db-context with dependencies

PHP Build Version
Package Version
Requires behat/behat Version ~3.3
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 edmondscommerce/behat-db-context contains the following files

Loading the files please wait ....