ralfmaxxx/behat_multidimensional_extension

It allows you to create multidimensional TableNode based on dot notation

0.1.2 2015-08-02 18:53 UTC

This package is auto-updated.

Last update: 2024-12-21 20:19:22 UTC


README

Latest Stable VersionTotal Downloads Latest Unstable Version License

Installation

In your behat.yml file just add this:

default:
    extensions:
         TableNode\Extension\NestedTableNodeExtension: ~

From now each TableNode object will be replaced by NestedTableNode instance, which adds one additional method: getNestedHash().

How to use it?

After you install this extension, you can describe your data with dot notation: model.value.something like in this example:

Feature: Something

    Scenario:
        When i do something with article:
            | article.name | author.id |
            | test         | 2         |

And you can take advantage of that in your step definition:

/**
 * @When i do something with article:
 */
public function iDoSomethingWithArticle(NestedTableNode $table)
{
    $table->getNestedHash();
}

Or just you do up to this point:

/**
 * @When i do something with article:
 */
public function iDoSomethingWithArticle(TableNode $table)
{
    /**
    * @var NestedTableNode
    */
    $table->getNestedHash();
}