-
-
Save havvg/2769333 to your computer and use it in GitHub Desktop.
| <?php | |
| namespace Ormigo\Behat\Context; | |
| class SymfonyPropelAclContext extends BehatContext | |
| { | |
| /** | |
| * @Given /^(?P<user>(user )?)"(?P<securityIdentity>[^"]+)" is (?P<granting>(granted|denied)) access (?P<mask>\d+) for (?P<class>(class )?)"(?P<objectIdentity>[^"]+)"( identified by "(?P<objectIdentifier>[^"]+)")?( on field "(?P<field>[^"]+)")?( with strategy "(?P<strategy>[^"]+)")?$/ | |
| */ | |
| public function updateAce($user, $securityIdentity, $granting, $mask, $class, $objectIdentity, $objectIdentifier = null, $field = null, $strategy = 'any') | |
| { | |
| // ... | |
| } | |
| } |
That's what i call megastep. You're trying to tell so much things with one sentence, that your listener (feature reader) will completely lose the whole point when you'll actually finish it.
Split it into consequent steps. Also, your steps seems too low-level. Lowering down to the class level in most cases is a signal that you're starting to do wrong job with the tool. Read this (if you haven't): Behat/Behat#92
I think I got the issue there. I guess the method is fine, but I should not use it directly for the step definition and should add something like Given I am allowed to create a booking which calls the given one.
But now I got a question on the very basic concept: Is it valid to have fixtures in BDD? If so, how are you supposed to have them applied in a nice way. @everzet
Stop thinking bout fixtures and testing while you're describing your features. You're talking with role you've stated in narrative of the feature, using your steps. You need to explain him something. Is it required to state that there should be already registered user on the site before describing how it would logging in? Yes? Then state it in the feature. If detail is not important - don't state it.
It's not about fixtures or tests, it's about being able to understand/explore functionality of your project and being able to explain it (with your features) to the benefitiar.
If I use the following then the last three parameters are mapped incorrectly (wrong values:
class,class,Ormigo\Bundle\OrmigoBundle\Model\Merchant).Given user "[email protected]" is granted access 1073741823 for class "Ormigo\Bundle\OrmigoBundle\Model\Merchant"