title: PHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found with PHPUnit 6 and PHP 7.0
body: <p>I am playing with php 7 and phpunit 6. Here is the test I wrote:</p>
  
  <pre><code>&lt;?php declare(strict_types=1);
  
  namespace Test;
  
  use DesignPatterns\Observer\User;
  use DesignPatterns\Observer\UserObserver;
  use PHPUnit\Framework\TestCase;
  
  class ObserverTest extends TestCase
  {
      public function testChangeInUserLeadsToUserObserverBeingNotified()
      {
          $observer = new UserObserver();
  
          $user = new User();
          $user-&gt;attach($observer);
  
          $user-&gt;changeEmail('foo@bar.com');
          $this-&gt;assertCount(1, $observer-&gt;getChangedUsers());
      }
  }
  </code></pre>
  
  <p>When I tried to run this test, I got the following error message:</p>
  
  <pre><code>PHP Fatal error:  Class 'PHPUnit\Framework\TestCase' not found in /home/.../.../Test/ObserverTest.php on line 9
  </code></pre>
  
  <p>I installed PHPUnit with composer, here is my composer.json file content:</p>
  
  <pre><code>{
      "require": {
          "phpunit/phpunit": "^6.0"
      },
      "autoload": {
          "psr-4": {"DesignPatterns\\": "src/"}
      }
  }
  </code></pre>
  
  <p>According to <a href="https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.test-dependencies" rel="noreferrer">PHPUnit 6 documentation</a>, your tests are now supposed to extends PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase.</p>
  
  <p>I know it's not an issue with autoloading. Actually, if I replace PHPUnit\Framework\TestCase with PHPUnit_Framework_TestCase, it works just fine, but I was wondering why this syntax didn't works.</p>
  
  <p>I tried some research on google, stackoverflow and PHPUnit's github repository, but couldn't find anything.</p>
  
  <p>I am looking forward for your answers,</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is how my files are organized:</p>
  
  <pre><code>src/
  ├── DataMapper
  │   ├── StorageAdapter.php
  │   ├── UserMapper.php
  │   └── User.php
  ├── Observer
  │   ├── UserObserver.php
  │   └── User.php
  Test/
  ├── DataMapperTest.php
  └── ObserverTest.php
  </code></pre>