Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#26 Forced custom context class #28

Merged
merged 4 commits into from Nov 15, 2011

Conversation

cystbear
Copy link

No description provided.

@@ -45,6 +45,11 @@ class ContextProcessor extends BaseProcessor
*/
protected function getContextClass(ContainerInterface $container, InputInterface $input)
{
$contextClass = $container->getParameter('behat.context.class');
if ('FeatureContext' !== $contextClass) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems wrong. It should be null !== check. And you simply need to set behat.context.class to null in behat_bundle.xml

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case possible variant when "getContextClass" method returns null. Is it applicable?

@@ -64,6 +69,6 @@ class ContextProcessor extends BaseProcessor
return $namespacedContext;
}

return $container->getParameter('behat.context.class');
return $contextClass;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throw \RuntimeException here about "can't determine context class"

@@ -3,6 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="behat.context.class">null</parameter>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just:

<parameter key="behat.context.class"></parameter>

and i'll merge

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everzet added a commit that referenced this pull request Nov 15, 2011
@everzet everzet merged commit dc99920 into Behat:master Nov 15, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants