Confusion between BehatContext and MinkContext
Extend the RawMinkContext
if you need to access the Mink Session (for browser automation).
Don't use Goutte directly.
BehatContext
is a basic context which would be a default choice for most of your own contexts, when you don't need Mink.
MinkContext
is a specialized context giving you the access to the Mink session (same as the RawMinkContext
). However, it also contains some basic step definitions. That's why you should never extend it, but rather use it as a subcontext. You'd be only able to extend it once, since the step definitions cannot be duplicated.
The question is very similar to your other question (look there for an example of Mink usage): What is wrong with my FeatureContext?
Using Behat doesn't mean you're following BDD. To learn more about it, read the following books:
To read about the tools:
- Mink: http://mink.behat.org/
- MinkExtension: http://extensions.behat.org/mink/index.html
- MinkContext class: https://github.com/Behat/MinkExtension/blob/master/src/Behat/MinkExtension/Context/MinkContext.php
- RawMinkContextClass: https://github.com/Behat/MinkExtension/blob/master/src/Behat/MinkExtension/Context/RawMinkContext.php