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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion Console/Processor/ContextProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public function process(ContainerInterface $container, InputInterface $input, Ou
*/
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?

return $contextClass;
}

$featuresPath = preg_replace('/\:\d+$/', '', $input->getArgument('features'));

$namespacedContext = null;
Expand All @@ -64,6 +69,6 @@ protected function getContextClass(ContainerInterface $container, InputInterface
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"

}
}