ステップでテーブルを使用できます。
And the result table should not contain:
|Value |
|Value1|
|Value2|
|Value3|
|Value4|
BehatはそれをTableNodeインスタンスとしてstepメソッドに渡します。
/**
* @Given /the result table should not contain:/
*/
public function thePeopleExist(TableNode $table)
{
$hash = $table->getHash();
foreach ($hash as $row) {
// ...
}
}
Gherkin言語での機能の記述について詳しくは、http://docs.behat.org/guides/1.gherkin.htmlをご覧ください。
余談:ほとんどの場合、機能でMinkステップを直接使用することは、ビジネスの言語ではないため、最善のアイデアではないことに注意してください。次のように記述した場合、シナリオはより読みやすく、保守しやすくなります。
When I press "Delete"
Then I should be on the user page
And I should see a list of users
And the following users should be deleted:
|Name |
|Biruwon|
|Kuba |
|Anna |
ステップの実装では、 Thenインスタンスを返すことでデフォルトのMinkステップを使用できます。
/**
* @Given /^I should see a list of users$/
*/
public function iShouldSeeListOfUsers()
{
return new Then('I should see "User list"');
}