This repository has been archived by the owner on Apr 4, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from cleverti/bdd_create_contenttypegroup
Bdd create contenttypegroup
- Loading branch information
Showing
3 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/EzSystems/BehatBundle/Features/ContentTypeGroup/create_content_type_group.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@contenttypegroup @adminFeature | ||
Feature: Creating a Content Type Group | ||
Create Content Type Group | ||
As an administrator or anonymous user | ||
I want to create a Content Type Group | ||
|
||
Scenario: Create a valid Content Type Group | ||
Given I am logged as an "administrator" | ||
And I don't have a Content Type Group "A" | ||
When I create a Content Type Group "A" | ||
Then I see a Content Type Group "A" | ||
|
||
Scenario: Attempt to create a Content Type Group with same name of an existing group | ||
Given I am logged as an "administrator" | ||
And I have a Content Type Group "A" | ||
When I create a Content Type Group "A" | ||
Then I see an invalid field error | ||
And I see 1 Content Type Group "A" | ||
|
||
Scenario: Attempt to create a Content Type Group with not authorized user | ||
Given I am not logged in | ||
When I create a Content Type Group "A" | ||
Then I see not authorized error |
50 changes: 50 additions & 0 deletions
50
src/EzSystems/BehatBundle/Features/Context/SentencesInterfaces/ContentTypeGroup.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* File containing the ContentTypeGroup class. | ||
* | ||
* This interface has the sentences definitions for the ContentTypeGroup steps | ||
* | ||
* @copyright Copyright (C) 1999-2014 eZ Systems AS. All rights reserved. | ||
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 | ||
* @version //autogentag// | ||
*/ | ||
|
||
namespace EzSystems\BehatBundle\Features\Context\SentencesInterfaces; | ||
|
||
use Behat\Gherkin\Node\TableNode; | ||
|
||
/** | ||
* ContentTypeGroup Sentences Interface | ||
*/ | ||
interface ContentTypeGroup | ||
{ | ||
/** | ||
* @Given /^I have (?:a |)Content Type Group "(?P<identifier>[A-Z])"$/ | ||
* @Given /^I have (?:a |)Content Type Group with "(?P<identifier>[^"])" identifier$/ | ||
*/ | ||
public function iHaveContentTypeGroup( $identifier ); | ||
|
||
/** | ||
* @Given /^I (?:do not|don\'t) have a Content Type Group "(?P<identifier>[A-Z])"$/ | ||
* @Given /^I (?:do not|don\'t) have a Content Type Group with "(?P<identifier>[^"])" identifier$/ | ||
*/ | ||
public function iDonTHaveContentTypeGroup( $identifier ); | ||
|
||
/** | ||
* @When /^I create a Content Type Group "(?P<identifier>[A-Z])"$/ | ||
* @When /^I create a Content Type Group with "(?P<identifier>[^"])" identifier$/ | ||
*/ | ||
public function iCreateContentTypeGroup( $identifier ); | ||
|
||
/** | ||
* @Then /^I see a Content Type Group "(?P<identifier>[A-Z])"$/ | ||
* @Then /^I see a Content Type Group with "(?P<identifier>[^"])" identifier$/ | ||
*/ | ||
public function iSeeContentTypeGroup( $identifier ); | ||
|
||
/** | ||
* @Then /^I see (?P<total>\d+) Content Type Group(?:s|) "(?P<identifier>[A-Z])"$/ | ||
* @Then /^I see (?P<total>\d+) Content Type Group(?:s|) with "(?P<identifier>[^"])" identifier$/ | ||
*/ | ||
public function iSeeTotalContentTypeGroup( $total, $identifier ); | ||
} |
28 changes: 28 additions & 0 deletions
28
src/EzSystems/BehatBundle/Features/Context/SentencesInterfaces/Error.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* File containing the Error class. | ||
* | ||
* This interface has the sentences definitions for the Error steps | ||
* | ||
* @copyright Copyright (C) 1999-2014 eZ Systems AS. All rights reserved. | ||
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 | ||
* @version //autogentag// | ||
*/ | ||
|
||
namespace EzSystems\BehatBundle\Features\Context\SentencesInterfaces; | ||
|
||
/** | ||
* Errors Sentences Interface | ||
*/ | ||
interface Error | ||
{ | ||
/** | ||
* @Then /^I see an invalid field error$/ | ||
*/ | ||
public function iSeeAnInvalidFieldError(); | ||
|
||
/** | ||
* @Then /^I see not authorized error$/ | ||
*/ | ||
public function iSeeNotAuthorizedError(); | ||
} |