title: How to force symfony's phpunit bridge to use phpunit 6.5 instead of 5.7?
body: <h1>Problem</h1>
  
  <p>I'm using <code>Symfony 3.3.10</code> on <code>PHP 7.0.25-0ubuntu0.16.04.1</code></p>
  
  <p>By default this combination goes with <code>phpunit 5.x</code>.</p>
  
  <p>But I want to force <code>phpunit 6.x</code>.</p>
  
  <h1>Context</h1>
  
  <p>When I invoke the <code>vendor/bin/simple-phpunit</code> for the first time, it installs <code>phpunit/phpunit</code> version <code>5.7.*</code> as stated in the source code here:</p>
  
  <p><a href="https://github.com/symfony/phpunit-bridge/blob/v3.4.11/bin/simple-phpunit" rel="noreferrer">https://github.com/symfony/phpunit-bridge/blob/v3.4.11/bin/simple-phpunit</a></p>
  
  <p>lines 18-27:</p>
  
  <pre><code>if (PHP_VERSION_ID &gt;= 70200) {
      // PHPUnit 6 is required for PHP 7.2+
      $PHPUNIT_VERSION = getenv('SYMFONY_PHPUNIT_VERSION') ?: '6.5';
  } elseif (PHP_VERSION_ID &gt;= 50600) {
      // PHPUnit 4 does not support PHP 7
      $PHPUNIT_VERSION = getenv('SYMFONY_PHPUNIT_VERSION') ?: '5.7';
  } else {
      // PHPUnit 5.1 requires PHP 5.6+
      $PHPUNIT_VERSION = '4.8';
  }
  </code></pre>
  
  <p>As my version of PHP is <code>7.0</code> it chooses phpunit version <code>5.7</code>.</p>
  
  <h1>Tried solution</h1>
  
  <p>I see I may "force" the bridge to go with phpunit <code>6.5</code> if I set it in the environment variable:</p>
  
  <p>In a shell, I do:</p>
  
  <pre><code>rm -Rf vendor
  export SYMFONY_PHPUNIT_VERSION=6.5
  composer install
  vendor/bin/simple-phpunit
  </code></pre>
  
  <p>Now I properly get: <code>PHPUnit 6.5.8</code></p>
  
  <p>Instead, if I logout and login again, it looses the env-var and the next invocation to <code>vendor/bin/simple-phpunit</code> and it forces to install a 5.7.</p>
  
  <h1>Don't tell me to put in the .bashrc</h1>
  
  <p>I already know I could set the env-var into my bash scripts and blah, blah, blah, but this is not an acceptable solution for two reasons:</p>
  
  <ol>
  <li>I maintain over 50 repositories. Having this set always in all shells might cause side-effects on other projects.</li>
  <li>If I make another developer to work on this repo, he should be able to do <code>git clone</code> + <code>composer install</code> + <code>vendor/bin/simple-phpunit</code> and it should be properly testing with no extra, manual, steps.</li>
  </ol>
  
  <h1>Question</h1>
  
  <p>Is it possible to tell the project (maybe something in the <code>composer.json</code>) to have some fancy setup so symfony's phpunit bridge is forced to use <code>phpunit 6.x</code> (for example <code>6.5</code>) over the <code>5.7</code> version for <strong>all</strong> installs of the repo and <strong>not</strong> depending on anything global external to the repo?</p>