title: Phpunit not running Symfony tests
body: <p>I'm trying to run a few functional tests in Symfony, but they won't work. Running phpunit targeting the whole AppBundle results in "No tests executed", and targeting it to a specific class gets me this error:</p>
  
  <pre><code>$ phpunit tests/AppBundle/ApplicationAvailabilityFunctionalTest.php
  PHP Fatal error:  Uncaught PHPUnit\Runner\Exception: Class 'tests/AppBundle/ApplicationAvailabilityFunctionalTest' could not be found in '/home/.../tests/AppBundle/ApplicationAvailabilityFunctionalTest.php'. in phar:///usr/local/bin/phpunit/phpunit/Runner/StandardTestSuiteLoader.php:107
  </code></pre>
  
  <p>Later I found out unit tests are not working as well, same error message.</p>
  
  <p>The functional test I'm trying to run is Symfony Best Practices example:</p>
  
  <pre><code>// tests/AppBundle/ApplicationAvailabilityFunctionalTest.php
  namespace Tests\AppBundle;
  
  use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
  
  class ApplicationAvailabilityFunctionalTest extends WebTestCase
  {
      /**
       * @dataProvider urlProvider
       */
      public function testPageIsSuccessful($url)
      {
          $client = self::createClient();
          $client-&gt;request('GET', $url);
  
          $this-&gt;assertTrue($client-&gt;getResponse()-&gt;isSuccessful());
      }
  
      public function urlProvider()
      {
          return array(
              array('/'),
              array('/team'),
              // ...
          );
      }
  } 
  </code></pre>
  
  <p>I have tried targeting another class, the DefaultControllerTest, but the same exception showed up.
  I'm running phpunit version 6.0.7 (downloaded as Phar), Symfony 3.2 and PHP 7.0. I've had to require phpunit/phpunit ^4.8 with composer since this exception appeared:</p>
  
  <pre><code>PHP Fatal error:  Class 'PHPUnit_Framework_TestCase' not found in /home/.../vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php on line 23
  </code></pre>
  
  <p>I have tried using <code>vendor/bin/phpunit</code> instead of the .phar version, and at least it detects the tests, but all of them have weird results.
  It doesn't recognize expectException, for instance:</p>
  
  <pre><code>$ vendor/bin/phpunit -c phpunit.xml.dist
  Error: Call to undefined method Tests\AppBundle\Util\Chart\ChartDataTest::expectException()
  </code></pre>
  
  <p>In functional tests, it doesn't seem to reach any path, even though they are perfectly accessible through the browser:</p>
  
  <pre><code>$ vendor/bin/phpunit -c phpunit.xml.dist
  1) Tests\AppBundle\ApplicationAvailabilityFunctionalTest::testPageIsSuccessful with data set #0 ('/')
  Failed asserting that false is true.
  </code></pre>
  
  <p>Is it a version issue?</p>
  
  <p><code>composer.json</code> file:</p>
  
  <pre><code>    {
  "name": "symfony/framework-standard-edition",
  "license": "MIT",
  "type": "project",
  "description": "The \"Symfony Standard Edition\" distribution",
  "autoload": {
      "psr-4": { "": "src/" },
      "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
  },
  "autoload-dev": {
      "psr-4": { "Tests\\": "tests/" }
  },
  "require": {
      "php": "&gt;=5.5.9",
      "symfony/symfony": "3.2.*",
      "doctrine/orm": "^2.5",
      "doctrine/doctrine-bundle": "^1.6",
      "doctrine/doctrine-cache-bundle": "^1.2",
      "symfony/swiftmailer-bundle": "^2.3",
      "symfony/monolog-bundle": "^3.0",
      "symfony/polyfill-apcu": "^1.0",
      "sensio/distribution-bundle": "^5.0",
      "sensio/framework-extra-bundle": "^3.0.2",
      "incenteev/composer-parameter-handler": "^2.0",
      "phpunit/phpunit": "^4.8"
  },
  "require-dev": {
      "sensio/generator-bundle": "^3.0",
      "symfony/phpunit-bridge": "^3.0",
      "doctrine/doctrine-fixtures-bundle": "^2.3"
  },
  "scripts": {
      "symfony-scripts": [
          "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
          "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
          "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
          "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
          "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
          "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
      ],
      "post-install-cmd": [
          "@symfony-scripts"
      ],
      "post-update-cmd": [
          "@symfony-scripts"
      ]
  },
  "config": {
      "platform": {
          "php": "5.5.9"
      }
  },
  "extra": {
      "symfony-app-dir": "app",
      "symfony-bin-dir": "bin",
      "symfony-var-dir": "var",
      "symfony-web-dir": "web",
      "symfony-tests-dir": "tests",
      "symfony-assets-install": "relative",
      "incenteev-parameters": {
          "file": "app/config/parameters.yml"
      },
      "branch-alias": {
          "dev-master": "3.2-dev"
      }
  }
     }
  </code></pre>
  
  <p>Here's <code>phpunit.xml.dist</code>: (currently in root folder, unmodified since project creation) </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!-- https://phpunit.de/manual/current/en/appendixes.configuration.html --&gt;
  &lt;phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
           backupGlobals="false"
           colors="true"
           bootstrap="app/autoload.php"
  &gt;
      &lt;php&gt;
          &lt;ini name="error_reporting" value="-1" /&gt;
          &lt;server name="KERNEL_DIR" value="app/" /&gt;
      &lt;/php&gt;
  
      &lt;testsuites&gt;
          &lt;testsuite name="Project Test Suite"&gt;
              &lt;directory&gt;tests&lt;/directory&gt;
          &lt;/testsuite&gt;
      &lt;/testsuites&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/Resources&lt;/directory&gt;
                  &lt;directory&gt;src/*/Bundle/*Bundle/Resources&lt;/directory&gt;
              &lt;/exclude&gt;
          &lt;/whitelist&gt;
      &lt;/filter&gt;
  &lt;/phpunit&gt;
  </code></pre>