Download the PHP package rocketage/behat-shortcode-extension without Composer

On this page you can find all versions of the php package rocketage/behat-shortcode-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-shortcode-extension

Behat Shortcode Extension

Description

This extension was created to provide a transparent way to feed runtime values into a feature.

For example my last use-case was verifying a sitemap:

The extension will replace the shortcode [date type=now format=Y-m-d] with the current date so the step code can perform a direct comparison.

Considerations

You should always seek to avoid having to use this extension!

Firstly, it should be possible to abstract runtime values into the step methods directly, without exposing them in the feature. The above example could easily be rewritten as:

Secondly runtimes values should be sought to be fixed by utilising doubles or mock services for your tests. Then runtime variables can be set in your 'given' steps:

Finally this extension uses reflection to inject the shortcode before the step method is called, which always feels wrong.

However, sometimes it's not always possible or practical to follow the perfect path and it can on occasions make features easier to read and step methods cleaner. Particularly when used in tables.

Installation

Install via composer:

Then add the extension to your behat.yml file:

Configuration

The extension currently only ships with a datetime shortcode, which effectively wraps the DateTime php class. The shortcode uses the following format [date type=now format=Y-m-d zone=UTC]. Because it uses DateTime you can use all the friendly contructor strings in the type field like 'yesterday', 'last week', 'next year', etc.

You can add more shortcodes by supplying classnames in the behat.yml file:

The custom classes must return a SimpleShortCode instance via the __invoke magic method:


All versions of behat-shortcode-extension with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
maiorano84/shortcodes Version ~1.0
behat/behat Version ~3.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 rocketage/behat-shortcode-extension contains the following files

Loading the files please wait ....