title: PHP include file with a namespace
body: <p>Just started working with the PHPUnit framework and I'm trying to incorporate it into existing code.</p>
  
  <p>Let's say I a class <code>Math</code> and I have it written like below,</p>
  
  <pre><code>&lt;?php
  
  /**
   *
   * Date: 19/12/2017
   * Time: 16:22
   */
  
  include_once 'include/testing_namespace.php';
  
  class Math extends TestCase {
  
      function isEven($x) {
          if ($this-&gt;assertInternalType(IsType::TYPE_NUMERIC)) {
              if ($x % 2 == 0) {
                  return true;
              } else {
                  return false;
              }
          }
      }
  
      function isOdd($y) {
          if ($this-&gt;assertInternalType(IsType::TYPE_NUMERIC)) {
              if ($y % 2 &gt;= 1) {
                  return true;
              } else {
                  return false;
              }
          }
      }
  
  }
  </code></pre>
  
  <p>And I have a php file <code>include/testing_namespace.php</code> like so,</p>
  
  <pre><code>&lt;?php
  
  namespace testing;
  
  use PHPUnit\Util\PHP;
  use PHPUnit\Framework\Constraint;
  use PHPUnit\Framework\Constraint\IsType;
  use PHPUnit\Framework\TestCase;
  use PHPUnit\Framework\Assert;
  
  $path = $_SERVER['APPL_PHYSICAL_PATH'];
  
  // class includes, may need to branch these off into separate include files
  include_once $path . '\vendor\phpunit\phpunit\src\Framework\Assert\Functions.php';
  include_once $path . '\vendor\phpunit\phpunit\src\Framework\TestCase.php';
  include_once $path . 'vendor\phpunit\phpunit\src\Framework\Constraint\IsEqual.php';
  include_once $path . 'vendor\phpunit\phpunit\src\Framework\Constraint\IsFalse.php';
  include_once $path . 'vendor\phpunit\phpunit\src\Framework\Constraint\IsEmpty.php';
  include_once $path . 'vendor\phpunit\phpunit\src\Framework\Constraint\IsNull.php';
  
  ?&gt;
  </code></pre>
  
  <p>Let's say I'm testing like so,</p>
  
  <pre><code>$m = new testing\Math();
  
  $integer1 = 8;
  
  var_dump($m-&gt;isEven($integer1));
  die();
  </code></pre>
  
  <p>(this seemed to work fine for a while)</p>
  
  <p>But let's say the file I'm testing in has a function declared also called <code>isEven</code> that is not in a namespace but is also included in the file.</p>
  
  <p>Let's say <code>oldfuncs/OldMath.php</code> also has an <code>isEven()</code> function with the same name.</p>
  
  <p>First question is, am I using namespaces correctly here? Also am I allowed to include a file with a namespace declaration and will that put the file that's including it into that namespace?</p>