title: Namespacing "Class not found" when autoloading via composer
body: <p>I created a small project with a <code>composer.json</code> and have this set up:</p>
  <pre class="lang-json prettyprint-override"><code>&quot;autoload&quot;: {
      &quot;psr-4&quot;: {
          &quot;MyApp\\&quot;: &quot;src/&quot;
      }
   },
   &quot;autoload-dev&quot;: {
      &quot;psr-4&quot;: {
         &quot;MyApp\\Tests\\&quot;: &quot;tests/&quot;
      }
   },
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Zj3Aw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zj3Aw.png" alt="Folder Structure" /></a></p>
  <h4><code>phpunit.xml</code></h4>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;phpunit xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
           xsi:noNamespaceSchemaLocation=&quot;https://schema.phpunit.de/9.5/phpunit.xsd&quot;
           bootstrap=&quot;vendor/autoload.php&quot;
           cacheResultFile=&quot;.phpunit.cache/test-results&quot;
           executionOrder=&quot;depends,defects&quot;
           forceCoversAnnotation=&quot;true&quot;
           beStrictAboutCoversAnnotation=&quot;true&quot;
           beStrictAboutOutputDuringTests=&quot;true&quot;
           beStrictAboutTodoAnnotatedTests=&quot;true&quot;
           convertDeprecationsToExceptions=&quot;true&quot;
           failOnRisky=&quot;true&quot;
           failOnWarning=&quot;true&quot;
           verbose=&quot;true&quot;&gt;
      &lt;testsuites&gt;
          &lt;testsuite name=&quot;default&quot;&gt;
              &lt;directory&gt;tests&lt;/directory&gt;
          &lt;/testsuite&gt;
      &lt;/testsuites&gt;
  
      &lt;coverage cacheDirectory=&quot;.phpunit.cache/code-coverage&quot;
                processUncoveredFiles=&quot;true&quot;&gt;
          &lt;include&gt;
              &lt;directory suffix=&quot;.php&quot;&gt;src&lt;/directory&gt;
          &lt;/include&gt;
      &lt;/coverage&gt;
  &lt;/phpunit&gt;
  </code></pre>
  <h4><code>ClientCrawler.php</code></h4>
  <pre class="lang-php prettyprint-override"><code>namespace MyApp;
  
  class ClientCrawler
  {
  
  }
  </code></pre>
  <h4><code>ClientCrawlerTest.php</code></h4>
  <pre class="lang-php prettyprint-override"><code>namespace MyApp\Tests;
  
  use MyApp\ClientCrawler;
  use PHPUnit\Framework\TestCase;
  
  class ClientCrawlerTest extends TestCase
  {
      public function testCheckClient()
      {
          $this-&gt;assertTrue(true);
  
          $crawler = new ClientCrawler();
      }
  }
  </code></pre>
  <h4>Test Command (PhpStorm)</h4>
  <pre><code>C:\xampp\php\php.exe D:\phpunit\phpunit.phar --no-configuration --filter MyApp\\Tests\\ClientCrawlerTest --test-suffix ClientCrawlerTest.php C:\Users\MYNAME\PhpstormProjects\CodingPractice\tests --teamcity --cache-result-file=C:\Users\MYNAME\PhpstormProjects\CodingPractice\.phpunit.result.cache
  </code></pre>
  <h4>Result</h4>
  <blockquote>
  <p>Error: Class &quot;MyApp\ClientCrawler&quot; not found</p>
  </blockquote>
  <h3>Things I tried</h3>
  <ul>
  <li><code>composer dump-autoload</code></li>
  <li>Deleted vendor and <code>composer install</code> (with another <code>dump-autoload</code>)</li>
  <li>Deleted the <code>.phpunit.result.cache</code></li>
  <li>Restarted PhpStorm</li>
  </ul>
  <p>Where am I wrong?</p>