Allow "given ... has data" notation for fixtures

Makes more sense in english when the fixture has already been created beforehand
This commit is contained in:
Ingo Schommer 2015-02-15 12:07:06 +13:00
parent 5bf9eb4961
commit 4dece01c34

View File

@ -144,8 +144,9 @@ class FixtureContext extends BehatContext
/** /**
* Example: Given a "page" "Page 1" with "URL"="page-1" and "Content"="my page 1" * Example: Given a "page" "Page 1" with "URL"="page-1" and "Content"="my page 1"
* Example: Given the "page" "Page 1" has "URL"="page-1" and "Content"="my page 1"
* *
* @Given /^(?:(an|a|the) )"(?<type>[^"]+)" "(?<id>[^"]+)" with (?<data>.*)$/ * @Given /^(?:(an|a|the) )"(?<type>[^"]+)" "(?<id>[^"]+)" (?:(with|has)) (?<data>".*)$/
*/ */
public function stepCreateRecordWithData($type, $id, $data) { public function stepCreateRecordWithData($type, $id, $data) {
$class = $this->convertTypeToClass($type); $class = $this->convertTypeToClass($type);