Я хочу сгенерировать шаг, внутри которого есть pyString. Я сделал следующее:
Сначала в моем файле .feature у меня есть эти коды
Then I should see the following something:
|label |value|
|test|12 |
И я определяю шаг следующим образом:
/**
* @Then /^I should see the following something:$/
*/
public function iShouldSeeTheFollowingAppStatistic(TableNode $table) {
$hash = $table->getHash ();
$steps=array();
foreach ( $hash as $row ) {
$then=new Then("I should see:\n\"\"\"\n \"label\" : \"".$row['label']."\"\n \"value\" : ".$row['value']."\n\"\"\"");
$steps[]=$then;
}
return $steps;
}
А для переменной $then я определяю еще один настраиваемый шаг:
/**
* @Then /^I should see:$/
*/
public function iShouldSee(PyStringNode $string)
{
echo $string;
}
Но, к сожалению, я все еще получаю ошибку undefined step.
Undefined step "I should see:
"""
"label" : "test"
"value" : 12
""""
Я думаю, что проблема в pystring. Как я могу справиться с этой ситуацией? Заранее спасибо.