Behat / Symfony2Extension

Symfony2 extension for Behat
MIT License
394 stars 106 forks source link

Array to string conversion error if a collection is passed as parameter to a context #117

Closed mraiffe closed 6 years ago

mraiffe commented 7 years ago

In symfony 2 parameter.yml

parameters:
    mycollection.parameter:
        param: value1
        param2: value2

In behat.yml:

default:
    suites:
        default:
            contexts:
                - FeatureContext:
                    collection_parameter: "%%mycollection.parameter%%"
    extensions:
        Behat\Symfony2Extension: ~

FeatureContext

    public function __construct($parameters)
    {
    }

The problem probably come from ServiceArgumentResolver where argument are treated like all arguments are scalar.

glennmcewan commented 7 years ago

There is a PR here if you're interested in taking a look.