Skip to content

Instantly share code, notes, and snippets.

@havvg
Created May 22, 2012 14:13
Show Gist options
  • Select an option

  • Save havvg/2769333 to your computer and use it in GitHub Desktop.

Select an option

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')
{
// ...
}
}
@havvg

havvg commented May 22, 2012

Copy link
Copy Markdown
Author

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

@everzet

everzet commented May 22, 2012

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment