PHPackages                             kerasai/behat-tokenizer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. kerasai/behat-tokenizer

ActiveLibrary[Testing &amp; Quality](/categories/testing)

kerasai/behat-tokenizer
=======================

Token replacement for Behat test suite.

1.0.0-alpha3(4y ago)020.9k↓50%1GPL-2.0-or-laterPHP

Since Jan 22Pushed 4y agoCompare

[ Source](https://github.com/kerasai/behat-tokenizer)[ Packagist](https://packagist.org/packages/kerasai/behat-tokenizer)[ RSS](/packages/kerasai-behat-tokenizer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

The Behat Tokenizer allows you to set and utilize tokens in your Behat test suite.

Installing Behat Tokenizer
--------------------------

[](#installing-behat-tokenizer)

Install the Behat tokenizer using [Composer](https://getcomposer.org):

```
$> composer require --dev kerasai/behat-tokenizer
```

Configuring Behat Tokenizer
---------------------------

[](#configuring-behat-tokenizer)

Add the `TokenizerExtension` class to the `behat.yml` file and tokens will be processed.

```
  extensions:
    Kerasai\Behat\Tokenizer\TokenizerExtension: { }
```

Using Behat Tokenizer in Contexts
---------------------------------

[](#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:

```
