title: PHPUnit is giving me autoload.php not found exception
body: <p><strong>UPDATE</strong></p>
  
  <p>I've fixed the problem, It was all about the right permissions in <code>app/cache</code> and <code>app/logs</code>.</p>
  
  <hr>
  
  <p>When I try to run PHPUnit in symfony2, Using this command <code>phpunit -c app/</code> i get this huge error message:</p>
  
  <pre><code>PHPUnit 3.7.28 by Sebastian Bergmann.
  
  Configuration read from /var/www/task/app/phpunit.xml.dist
  
  PHP Warning:  Uncaught exception 'PHPUnit_Framework_Error_Warning' with message 'require_once(/var/www/task/vendor/symfony/symfony/vendor/autoload.php): failed to open stream: No such file or directory' in /var/www/task/vendor/symfony/symfony/autoload.php.dist:9 Stack trace:
  #0 /var/www/task/vendor/symfony/symfony/autoload.php.dist(9): PHPUnit_Util_ErrorHandler::handleError(2, 'require_once(/v...', '/var/www/task/v...', 9, Array)
  #1 /var/www/task/vendor/symfony/symfony/autoload.php.dist(9): require_once()
  #2 /var/www/task/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php(26): require_once('/var/www/task/v...')
  #3 /var/www/task/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php(47): require_once('/var/www/task/v...')
  #4 /var/www/task/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php(54): Symfony\Bundle\FrameworkBundle\Tests\Functional\WebTestCase::getKernelClass()
  #5 /var/www/task/vendor/symfony/symfon in /var/www/task/vendor/symfony/symfony/autoload.php.dist on line 9 
  
  PHP Stack trace:
  PHP   1. {main}() /home/rafael/composer-packages/vendor/phpunit/phpunit/composer/bin/phpunit:0
  PHP   2. PHPUnit_TextUI_Command::main() /home/rafael/composer-packages/vendor/phpunit/phpunit/composer/bin/phpunit:63
  PHP   3. PHPUnit_TextUI_Command-&gt;run() /home/rafael/composer-packages/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:129
  PHP   4. PHPUnit_TextUI_TestRunner-&gt;doRun() /home/rafael/composer-packages/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:176
  PHP   5. PHPUnit_Framework_TestSuite-&gt;run() /var/www/task/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php:349
  PHP   6. PHPUnit_Framework_TestSuite-&gt;run() /var/www/task/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:705
  PHP   7. PHPUnit_Framework_TestSuite-&gt;runTest() /var/www/task/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:745
  PHP   8. PHPUnit_Framework_TestCase-&gt;run() /var/www/task/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:775
  PHP   9. PHPUnit_Framework_TestResult-&gt;run() /var/www/task/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:783
  PHP  10. PHPUnit_Framework_TestCase-&gt;runBare() /var/www/task/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php:648
  PHP  11. Tsk\UserBundle\Tests\Unit\Entity\ModelTestCase-&gt;setUp() /var/www/task/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:835
  PHP  12. Symfony\Bundle\FrameworkBundle\Test\WebTestCase::createClient() /var/www/task/src/Tsk/UserBundle/Tests/Unit/Entity/ModelTestCase.php:13
  PHP  13. Symfony\Bundle\FrameworkBundle\Tests\Functional\WebTestCase::createKernel() /var/www/task/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php:46
  PHP  14. Symfony\Bundle\FrameworkBundle\Tests\Functional\WebTestCase::getKernelClass() /var/www/task/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php:54
  PHP  15. require_once() /var/www/task/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php:47
  PHP  16. require_once() /var/www/task/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php:26 PHP Fatal error:  main(): Failed opening required '/var/www/task/vendor/symfony/symfony/vendor/autoload.php' (include_path='/var/www/task/vendor/phpunit/php-text-template:/var/www/task/vendor/phpunit/phpunit-mock-objects:/var/www/task/vendor/phpunit/php-timer:/var/www/task/vendor/phpunit/php-token-stream:/var/www/task/vendor/phpunit/php-file-iterator:/var/www/task/vendor/phpunit/php-code-coverage:/var/www/task/vendor/phpunit/phpunit:/var/www/task/vendor/symfony/yaml:/home/rafael/composer-packages/vendor/phpunit/php-text-template:/home/rafael/composer-packages/vendor/phpunit/phpunit-mock-objects:/home/rafael/composer-packages/vendor/phpunit/php-timer:/home/rafael/composer-packages/vendor/phpunit/php-file-iterator:/home/rafael/composer-packages/vendor/phpunit/php-code-coverage:/home/rafael/composer-packages/vendor/phpunit/php-token-stream:/home/rafael/composer-packages/vendor/phpunit/phpunit:/home/rafael/composer-packages/vendor/symfony/yaml:.:/usr/share/php:/usr/share/pear') in /var/www/task/vendor/symfony/symfony/autoload.php.dist on line 9 
  
  PHP Stack trace:
  PHP   1. {main}() /home/rafael/composer-packages/vendor/phpunit/phpunit/composer/bin/phpunit:0
  PHP   2. PHPUnit_TextUI_Command::main() /home/rafael/composer-packages/vendor/phpunit/phpunit/composer/bin/phpunit:63
  PHP   3. PHPUnit_TextUI_Command-&gt;run() /home/rafael/composer-packages/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:129
  PHP   4. PHPUnit_TextUI_TestRunner-&gt;doRun() /home/rafael/composer-packages/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:176
  PHP   5. PHPUnit_Framework_TestSuite-&gt;run() /var/www/task/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php:349
  PHP   6. PHPUnit_Framework_TestSuite-&gt;run() /var/www/task/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:705
  PHP   7. PHPUnit_Framework_TestSuite-&gt;runTest() /var/www/task/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:745
  PHP   8. PHPUnit_Framework_TestCase-&gt;run() /var/www/task/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:775
  PHP   9. PHPUnit_Framework_TestResult-&gt;run() /var/www/task/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:783
  PHP  10. PHPUnit_Framework_TestCase-&gt;runBare() /var/www/task/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php:648
  PHP  11. Tsk\UserBundle\Tests\Unit\Entity\ModelTestCase-&gt;setUp() /var/www/task/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:835
  PHP  12. Symfony\Bundle\FrameworkBundle\Test\WebTestCase::createClient() /var/www/task/src/Tsk/UserBundle/Tests/Unit/Entity/ModelTestCase.php:13
  PHP  13. Symfony\Bundle\FrameworkBundle\Tests\Functional\WebTestCase::createKernel() /var/www/task/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php:46
  PHP  14. Symfony\Bundle\FrameworkBundle\Tests\Functional\WebTestCase::getKernelClass() /var/www/task/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php:54
  PHP  15. require_once() /var/www/task/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php:47
  PHP  16. require_once() /var/www/task/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php:26
  </code></pre>
  
  <p>My <code>phpunit.xml.dist</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html --&gt;
  &lt;phpunit
      backupGlobals               = "false"
      backupStaticAttributes      = "false"
      colors                      = "true"
      convertErrorsToExceptions   = "true"
      convertNoticesToExceptions  = "true"
      convertWarningsToExceptions = "true"
      processIsolation            = "false"
      stopOnFailure               = "false"
      syntaxCheck                 = "false"
      bootstrap                    = "bootstrap.php.cache" &gt;
  
      &lt;testsuites&gt;
          &lt;testsuite name="Project Test Suite"&gt;
              &lt;directory&gt;../src/*/*Bundle/Tests&lt;/directory&gt;
              &lt;directory&gt;../src/*/Bundle/*Bundle/Tests&lt;/directory&gt;
          &lt;/testsuite&gt;
      &lt;/testsuites&gt;
  
      &lt;!--
      &lt;php&gt;
          &lt;server name="KERNEL_DIR" value="/path/to/your/app/" /&gt;
      &lt;/php&gt;
      --&gt;
  
      &lt;filter&gt;
          &lt;whitelist&gt;
              &lt;directory&gt;../src&lt;/directory&gt;
              &lt;exclude&gt;
                  &lt;directory&gt;../src/*/*Bundle/Resources&lt;/directory&gt;
                  &lt;directory&gt;../src/*/*Bundle/Tests&lt;/directory&gt;
                  &lt;directory&gt;../src/*/Bundle/*Bundle/Resources&lt;/directory&gt;
                  &lt;directory&gt;../src/*/Bundle/*Bundle/Tests&lt;/directory&gt;
              &lt;/exclude&gt;
          &lt;/whitelist&gt;
      &lt;/filter&gt;
  
  &lt;/phpunit&gt;
  </code></pre>
  
  <p>My <code>app/autoload.php</code>:</p>
  
  <pre><code>&lt;?php
  
  use Doctrine\Common\Annotations\AnnotationRegistry;
  use Composer\Autoload\ClassLoader;
  
  /**
   * @var ClassLoader $loader
   */
  $loader = require __DIR__.'/../vendor/autoload.php';
  
  AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
  
  return $loader;
  </code></pre>
  
  <p>My <code>vendor/symfony/symfony/autoload.php.dist</code> :</p>
  
  <pre><code>&lt;?php
  
  if (version_compare(PHP_VERSION, '5.4', '&gt;=') &amp;&amp; gc_enabled()) {
      // Disabling Zend Garbage Collection to prevent segfaults with PHP5.4+
      // https://bugs.php.net/bug.php?id=53976
      gc_disable();
  }
  
  $loader = require_once __DIR__.'/vendor/autoload.php';
  
  use Doctrine\Common\Annotations\AnnotationRegistry;
  
  AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
  
  return $loader;
  </code></pre>
  
  <p>Any help would be greatly appreciated, I'm stuck in this error for like 4 hours.</p>