title: What is wrong with my FeatureContext?
body: <p>I believe I am not clear on BehatContext versus MinkContext and am not sure why I would inherit from one or the other in my app. Basically I am not clear on why I have to instantiate a new Client object in every function. I should be able to use $this since I have goutte loaded in my behat.yml file.</p>
  
  <p>Any tips please?</p>
  
  <pre><code>&lt;?php
  
  namespace Main\ReferralCaptureBundle\Features\Context;
  
  use Main\ReferralCaptureBundle\Features\Context\FeatureContext;
  
  use Symfony\Component\HttpKernel\KernelInterface;
  use Behat\Symfony2Extension\Context\KernelAwareInterface;
  use Behat\MinkExtension\Context\MinkContext;
  use Behat\MinkExtension\Context\RawMinkContext;
  
  use Behat\Behat\Context\BehatContext,
      Behat\Behat\Exception\PendingException;
  use Behat\Gherkin\Node\PyStringNode,
      Behat\Gherkin\Node\TableNode;
  
  use Goutte\Client;
  
  //
  // Require 3rd-party libraries here:
  //
     require_once 'PHPUnit/Autoload.php';
     require_once 'PHPUnit/Framework/Assert/Functions.php';
  //
  
  /**
   * Feature context.
   */
  class FeatureContext extends RawMinkContext //MinkContext if you want to test web
                    implements KernelAwareInterface
  {
      private $kernel;
      private $parameters;
  
      /**
       * Initializes context with parameters from behat.yml.
       *
       * @param array $parameters
       */
      public function __construct(array $parameters)
      {
          $this-&gt;parameters = $parameters;
          $this-&gt;useContext('behat', new BehatContext);
          $this-&gt;useContext('mink', new MinkContext);
      }
  
      /**
       * Sets HttpKernel instance.
       * This method will be automatically called by Symfony2Extension ContextInitializer.
       *
       * @param KernelInterface $kernel
       */
      public function setKernel(KernelInterface $kernel)
      {
          $this-&gt;kernel = $kernel;
      }
  
  
  
      /**
       * @Given /^I am on homepage$/
       */
      public function iAmOnHomepage()
      {
  
        // $this-&gt;getSession()-&gt;visit("/");
  
          $client = new Client();
          $crawler = $client-&gt;request('GET', 'http://local.referral.com/');
  
          $link = $crawler-&gt;selectLink('I am a Physician')-&gt;link();
  
  
         if (!count($link)&gt;0)
         {
            throw new Exception("Home Page Not Loaded:\n");   
  
         } 
      }
  
      /**
       * @Given /^I follow "([^"]*)"$/
       */
      public function iFollow($arg1)
      {
          $client = new Client();
          $crawler = $client-&gt;request('GET', 'http://local.referral.com/');
  
         $link = $crawler-&gt;selectLink('Register')-&gt;link();
         $crawler = $client-&gt;click($link);         
  
      }
  
      /**
       * @When /^I fill in "([^"]*)" with "([^"]*)"$/
       */
      public function iFillInWith($arg1, $arg2)
      {
          throw new PendingException();
      }
  
      /**
       * @Given /^I press "([^"]*)"$/
       */
      public function iPress($arg1)
      {
          throw new PendingException();
      }
  
      /**
       * @Then /^I should see "([^"]*)"$/
       */
      public function iShouldSee($arg1)
      {
          throw new PendingException();
      }
  
      /**
       * @Given /^I should be on homepage$/
       */
      public function iShouldBeOnHomepage()
      {
          throw new PendingException();
      }
  
  
  
  
  
  
  }
  </code></pre>