More verbose fixture step definitions

Too many clashes with other steps otherwise,
e.g. with 'And the preview contains "You can fill"'
This commit is contained in:
Ingo Schommer 2013-06-05 14:17:28 +02:00
parent 55c7f578fd
commit aab86a6b08
2 changed files with 24 additions and 24 deletions

View File

@ -166,23 +166,23 @@ use the inline definition syntax. The following example shows some syntax variat
Background: Background:
# Creates a new page without data. Can be accessed later under this identifier # Creates a new page without data. Can be accessed later under this identifier
Given a page "Page 1" Given a "page" "Page 1"
# Uses a custom RegistrationPage type # Uses a custom RegistrationPage type
And a registration page "Register" And an "error page" "Register"
# Creates a page with inline properties # Creates a page with inline properties
And a page "Page 2" with "URLSegment"="page-1" and "Content"="my page 1" And a "page" "Page 2" with "URLSegment"="page-1" and "Content"="my page 1"
# Field names can be tabular, and based on DataObject::$field_labels # Field names can be tabular, and based on DataObject::$field_labels
And the page "Page 3" has the following data And the "page" "Page 3" has the following data
| Content | <blink> | | Content | <blink> |
| My Property | foo | | My Property | foo |
| My Boolean | bar | | My Boolean | bar |
# Pages are published by default, can be explicitly unpublished # Pages are published by default, can be explicitly unpublished
And the page "Page 1" is not published And the "page" "Page 1" is not published
# Create a hierarchy, and reference a record created earlier # Create a hierarchy, and reference a record created earlier
And the page "Page 1.1" is a child of a page "Page 1" And the "page" "Page 1.1" is a child of a "page" "Page 1"
# Specific page type step # Specific page type step
And a page "My Redirect" which redirects to a page "Page 1" And a "page" "My Redirect" which redirects to a "page" "Page 1"
And a member "Website User" with "FavouritePage"="=>Page.Page 1" And a "member" "Website User" with "FavouritePage"="=>Page.Page 1"
@javascript @javascript
Scenario: View a page in the tree Scenario: View a page in the tree

View File

@ -123,9 +123,9 @@ class FixtureContext extends BehatContext
} }
/** /**
* Example: Given a page "Page 1" * Example: Given a "page" "Page 1"
* *
* @Given /^(?:(an|a|the) )(?<type>[^"]+)"(?<id>[^"]+)"$/ * @Given /^(?:(an|a|the) )"(?<type>[^"]+)" "(?<id>[^"]+)"$/
*/ */
public function stepCreateRecord($type, $id) public function stepCreateRecord($type, $id)
{ {
@ -139,9 +139,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"
* *
* @Given /^(?:(an|a|the) )(?<type>[^"]+)"(?<id>[^"]+)" with (?<data>.*)$/ * @Given /^(?:(an|a|the) )"(?<type>[^"]+)" "(?<id>[^"]+)" with (?<data>.*)$/
*/ */
public function stepCreateRecordWithData($type, $id, $data) public function stepCreateRecordWithData($type, $id, $data)
{ {
@ -162,12 +162,12 @@ class FixtureContext extends BehatContext
} }
/** /**
* Example: And the page "Page 2" has the following data * Example: And the "page" "Page 2" has the following data
* | Content | <blink> | * | Content | <blink> |
* | My Property | foo | * | My Property | foo |
* | My Boolean | bar | * | My Boolean | bar |
* *
* @Given /^(?:(an|a|the) )(?<type>[^"]+)"(?<id>[^"]+)" has the following data$/ * @Given /^(?:(an|a|the) )"(?<type>[^"]+)" "(?<id>[^"]+)" has the following data$/
*/ */
public function stepCreateRecordWithTable($type, $id, $null, TableNode $fieldsTable) public function stepCreateRecordWithTable($type, $id, $null, TableNode $fieldsTable)
{ {
@ -181,9 +181,9 @@ class FixtureContext extends BehatContext
} }
/** /**
* Example: Given the page "Page 1.1" is a child of the page "Page1" * Example: Given the "page" "Page 1.1" is a child of the "page" "Page1"
* *
* @Given /^(?:(an|a|the) )(?<type>[^"]+)"(?<id>[^"]+)" is a (?<relation>[^\s]*) of (?:(an|a|the) )(?<relationType>[^"]+)"(?<relationId>[^"]+)"/ * @Given /^(?:(an|a|the) )"(?<type>[^"]+)" "(?<id>[^"]+)" is a (?<relation>[^\s]*) of (?:(an|a|the) )"(?<relationType>[^"]+)" "(?<relationId>[^"]+)"/
*/ */
public function stepUpdateRecordRelation($type, $id, $relation, $relationType, $relationId) public function stepUpdateRecordRelation($type, $id, $relation, $relationType, $relationId)
{ {
@ -213,9 +213,9 @@ class FixtureContext extends BehatContext
} }
/** /**
* Example: Given the page "Page 1" is not published * Example: Given the "page" "Page 1" is not published
* *
* @Given /^(?:(an|a|the) )(?<type>[^"]+)"(?<id>[^"]+)" is (?<state>[^"]*)$/ * @Given /^(?:(an|a|the) )"(?<type>[^"]+)" "(?<id>[^"]+)" is (?<state>[^"]*)$/
*/ */
public function stepUpdateRecordState($type, $id, $state) public function stepUpdateRecordState($type, $id, $state)
{ {
@ -271,9 +271,9 @@ class FixtureContext extends BehatContext
} }
/** /**
* Example: Given a member "Admin" belonging to "Admin Group" * Example: Given a "member" "Admin" belonging to "Admin Group"
* *
* @Given /^(?:(an|a|the) )member "(?<id>[^"]+)" belonging to "(?<groupId>[^"]+)"$/ * @Given /^(?:(an|a|the) )"member" "(?<id>[^"]+)" belonging to "(?<groupId>[^"]+)"$/
*/ */
public function stepCreateMemberWithGroup($id, $groupId) public function stepCreateMemberWithGroup($id, $groupId)
{ {
@ -285,9 +285,9 @@ class FixtureContext extends BehatContext
} }
/** /**
* Example: Given a member "Admin" belonging to "Admin Group" with "Email"="test@test.com" * Example: Given a "member" "Admin" belonging to "Admin Group" with "Email"="test@test.com"
* *
* @Given /^(?:(an|a|the) )member "(?<id>[^"]+)" belonging to "(?<groupId>[^"]+)" with (?<data>.*)$/ * @Given /^(?:(an|a|the) )"member" "(?<id>[^"]+)" belonging to "(?<groupId>[^"]+)" with (?<data>.*)$/
*/ */
public function stepCreateMemberWithGroupAndData($id, $groupId, $data) public function stepCreateMemberWithGroupAndData($id, $groupId, $data)
{ {
@ -310,9 +310,9 @@ class FixtureContext extends BehatContext
} }
/** /**
* Example: Given a group "Admin" with permissions "Access to 'Pages' section" and "Access to 'Files' section" * Example: Given a "group" "Admin" with permissions "Access to 'Pages' section" and "Access to 'Files' section"
* *
* @Given /^(?:(an|a|the) )group "(?<id>[^"]+)" (?:(with|has)) permissions (?<permissionStr>.*)$/ * @Given /^(?:(an|a|the) )"group" "(?<id>[^"]+)" (?:(with|has)) permissions (?<permissionStr>.*)$/
*/ */
public function stepCreateGroupWithPermissions($id, $permissionStr) public function stepCreateGroupWithPermissions($id, $permissionStr)
{ {