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
Conversation
@@ -45,6 +45,11 @@ class ContextProcessor extends BaseProcessor | |||
*/ | |||
protected function getContextClass(ContainerInterface $container, InputInterface $input) | |||
{ | |||
$contextClass = $container->getParameter('behat.context.class'); | |||
if ('FeatureContext' !== $contextClass) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure?, at other configs null passed explicit.
https://github.com/Behat/Behat/blob/master/src/Behat/Behat/DependencyInjection/config/behat.xml#L6
#26 Forced custom context class
No description provided.