Created
October 15, 2015 16:04
-
-
Save bdunogier/8b3bfcd4fdc49e7c0dc2 to your computer and use it in GitHub Desktop.
Testing application exception handling with Behat
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
Feature: Handling of Unauthorized repository exceptions | |
Scenario: When a Repository UnauthorizedException is throw, anonymous users are shown the login screen # vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Features/Exception/unauthorized_login_form.feature:2 | |
Given that I am not logged in # eZ\Bundle\EzPublishCoreBundle\Features\Context\ExceptionContext::iAmNotLoggedIn() | |
When a repository UnauthorizedException is thrown during an HTTP request # eZ\Bundle\EzPublishCoreBundle\Features\Context\ExceptionContext::anExceptionIsThrownDuringAnHTTPRequest() | |
Then the login form is shown # eZ\Bundle\EzPublishCoreBundle\Features\Context\ExceptionContext::theLoginFormIsShown() | |
Scenario: When a Repository UnauthorizedException is throw, authenticated users are shown the exception # vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Features/Exception/unauthorized_login_form.feature:7 | |
Given that I am logged in # eZ\Bundle\EzPublishCoreBundle\Features\Context\ExceptionContext::iAmLoggedIn() | |
When a repository UnauthorizedException is thrown during an HTTP request # eZ\Bundle\EzPublishCoreBundle\Features\Context\ExceptionContext::anExceptionIsThrownDuringAnHTTPRequest() | |
Then an eZ\Publish\Core\Base\Exceptions\UnauthorizedException is displayed # eZ\Bundle\EzPublishCoreBundle\Features\Context\ExceptionContext::anAccessDeniedExceptionIsThrown() | |
And an Symfony\Component\Security\Core\Exception\AccessDeniedException is displayed # eZ\Bundle\EzPublishCoreBundle\Features\Context\ExceptionContext::anAccessDeniedExceptionIsThrown() | |
2 scénarios (2 succès) | |
7 étapes (7 succès) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment