Download the PHP package kerasai/behat-tokenizer without Composer
On this page you can find all versions of the php package kerasai/behat-tokenizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kerasai/behat-tokenizer
More information about kerasai/behat-tokenizer
Files in kerasai/behat-tokenizer
Package behat-tokenizer
Short Description Token replacement for Behat test suite.
License GPL-2.0-or-later
Informations about the package behat-tokenizer
The Behat Tokenizer allows you to set and utilize tokens in your Behat test suite.
Installing Behat Tokenizer
Install the Behat tokenizer using Composer:
Configuring Behat Tokenizer
Add the TokenizerExtension
class to the behat.yml
file and tokens will be
processed.
Using Behat Tokenizer in Contexts
To utilize the Behat Tokenizer in context classes, simple implement \Kerasai\Behat\Tokenizer\TokenizerAwareInterface
and the context will have its ::setTokenizer
method called with the tokenizer.
Additionally you may use \Kerasai\Behat\Tokenizer\TokenizerAwareTrait
to
easily implement the interface.
From there you may access the tokenizer within the context:
The token will be processed for all arguments within Behat features:
Custom Token Replacers
In addition to explicit token setting and replacement, custom replacer classes may be implemented to perform token replacement.
Replacer classes must implement \Kerasai\Behat\Tokenizer\Replacer\ReplacerInterface
and may extend \Kerasai\Behat\Tokenizer\Replacer\ReplacerBase
for convenience.
See \Kerasai\Behat\Tokenizer\Replacer\TimestampReplacer
.
In order to utilize the custom replacer classes, they must be exposed to the
Behat Tokenizer in the behat.yml
configuration. In the simplest form, just the
class name may be utilized.