title: Use vs Include in PHP
body: <p>I'm trying to get my head around PHP namespaces and testing with PHPUnit.</p>
  
  <p>These tests from Codewars pass when I run <code>phpunit test.php</code> in the command line on Windows:</p>
  
  <pre><code>&lt;?php
  require 'solution.php';
  use PHPUnit\Framework\TestCase;
  
  class myTests extends TestCase {
    public function testExamples() {
          $this-&gt;assertEquals(pair_sum([1,9,2,8,3,7,4,6,5,5,13,14,11,13,-1],10),6);
          $this-&gt;assertEquals(pair_sum([1,2,3,1],3),1);
          $this-&gt;assertEquals(pair_sum([1,3,2,2],4),2);
          $this-&gt;assertEquals(pair_sum([1],4),false);
          $this-&gt;assertEquals(pair_sum([2,3,10,-5],5),2);
    }
  }
  </code></pre>
  
  <p>However, when I comment out <code>use PHPUnit\Framework\TestCase;</code> I get <code>Class 'TestCase' not found</code> which makes sense since there is no reference to the needed classes/functions.</p>
  
  <p>What's confusing me though is that lots of answers here on SO about namespacing claim that the <code>use</code> keyword is NOT a substitute for <code>include/require</code> and that the classes still need to be included/autoloaded(?).</p>
  
  <p>I'm not using any autoloading here - just a <code>solution.php</code> file and the tests above in a <code>test.php</code> file.</p>
  
  <p>Can someone please explain what I'm missing here? How come the tests work without  any explicit including of the PHPunit functionality?</p>
  
  <p>I should mention that I have PHPUnit installed globally via Composer.</p>