title: Class 'Behat\Behat\Context\BehatContext' not found in PHP with Behat
body: <p>I am trying to learn Behat using the <a href="http://docs.behat.org/quick_intro.html" rel="noreferrer">tutorial on the website</a>.</p>
  
  <p>The first step goes OK, no errors appear.</p>
  
  <p>But when I am changing the <code>ls_project/features/bootstrap/FeatureContext.php</code>, as shown in the tutorial second step, I am getting the following error: <code>'Behat\Behat\Context\BehatContext' not found</code>.</p>
  
  <p>The tutorial code, to which the change is applied:</p>
  
  <pre><code># features/bootstrap/FeatureContext.php
  &lt;?php
  
  use Behat\Behat\Context\BehatContext,
      Behat\Behat\Exception\PendingException;
  use Behat\Gherkin\Node\PyStringNode,
      Behat\Gherkin\Node\TableNode;
  
  class FeatureContext extends BehatContext
  {
      /**
       * @Given /^I am in a directory "([^"]*)"$/
       */
      public function iAmInADirectory($dir)
      {
          if (!file_exists($dir)) {
              mkdir($dir);
          }
          chdir($dir);
      }
  }
  </code></pre>
  
  <p>The full error log: </p>
  
  <pre><code>11:51:33 / ME : /var/www/test-driven/behat/ls_project
  $ behat
  # features/bootstrap/FeatureContext.php
  PHP Fatal error:  Class 'Behat\Behat\Context\BehatContext' not found in /var/www/test-driven/behat/ls_project/features/bootstrap/FeatureContext.php on line 10
  PHP Stack trace:
  PHP   1. {main}() /opt/Behat/bin/behat:0
  PHP   2. Symfony\Component\Console\Application-&gt;run() /opt/Behat/bin/behat:31
  PHP   3. Behat\Testwork\Cli\Application-&gt;doRun() /opt/Behat/vendor/symfony/console/Symfony/Component/Console/Application.php:121
  PHP   4. Symfony\Component\Console\Application-&gt;doRun() /opt/Behat/src/Behat/Testwork/Cli/Application.php:90
  PHP   5. Symfony\Component\Console\Application-&gt;doRunCommand() /opt/Behat/vendor/symfony/console/Symfony/Component/Console/Application.php:191
  PHP   6. Symfony\Component\Console\Command\Command-&gt;run() /opt/Behat/vendor/symfony/console/Symfony/Component/Console/Application.php:892
  PHP   7. Behat\Testwork\Cli\Command-&gt;execute() /opt/Behat/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:241
  PHP   8. Behat\Testwork\Tester\Cli\ExerciseController-&gt;execute() /opt/Behat/src/Behat/Testwork/Cli/Command.php:63
  PHP   9. Behat\Testwork\Tester\Cli\ExerciseController-&gt;testSpecifications() /opt/Behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php:106
  PHP  10. Behat\Testwork\EventDispatcher\Tester\EventDispatchingExercise-&gt;test() /opt/Behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php:137
  PHP  11. Behat\Testwork\Tester\Runtime\RuntimeExercise-&gt;test() /opt/Behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingExercise.php:65
  PHP  12. Behat\Testwork\Environment\EnvironmentManager-&gt;buildEnvironment() /opt/Behat/src/Behat/Testwork/Tester/Runtime/RuntimeExercise.php:67
  PHP  13. Behat\Behat\Context\Environment\Handler\ContextEnvironmentHandler-&gt;buildEnvironment() /opt/Behat/src/Behat/Testwork/Environment/EnvironmentManager.php:69
  PHP  14. Behat\Behat\Context\Environment\UninitializedContextEnvironment-&gt;registerContextClass() /opt/Behat/src/Behat/Behat/Context/Environment/Handler/ContextEnvironmentHandler.php:75
  </code></pre>
  
  <p>Could anyone please help me resolving this issue?</p>