title: Cannot run phpunit test, failed opening required class
body: <p>So, here is the strucuture of my project <br> <br></p>
  
  <pre><code>project_name
    /classes
        Calculator.php
    /test
        CalculatorTest.php
    /vendor
        // Related composer/phpunit etc ... stuff
    composer.json
    composer.lock
  </code></pre>
  
  <p><strong>Calculator.php <br></strong></p>
  
  <pre><code>&lt;?php
  class Calculator{
      public function double($input){
          return $input * 2; 
      }
  }
  </code></pre>
  
  <p><strong>CalculatorTest.php <br></strong></p>
  
  <pre><code>&lt;?php
  
  require_once '../classes/Calculator.php'; 
  
  class CalculatorTest extends PHPUnit_Framework_TestCase{
  
      public $testClass; 
  
      public function setUp(){
          $testClass = new Calculator; 
      }
  
      public function testDouble(){
          $result = $testClass-&gt;double(2); 
          $this-&gt;assertEquals(4, $result);        
      }
  
  }
  </code></pre>
  
  <p>When I run <em>phpunit ../../test</em>, I get the following error:<br></p>
  
  <blockquote>
    <p>Warning: require_once(../classes/Calculator.php): failed to open
    stream: No such file or directory in
    C:\wamp\www\phpunit\test\CalculatorTest.php on line 3 </p>
    
    <p>Fatal error:
    require_once(): Failed opening required '../classes/Calculator.php'
    (include_path='.;C:\php\pear') in
    C:\wamp\www\phpunit\test\CalculatorTest.php on line 3</p>
  </blockquote>
  
  <p>I can't find a fix. Do you have any idea?</p>
  
  <p><strong>EDIT</strong> <br>
  Got, it, forget the <strong>spl_autoload_register</strong> within the tests classes: <br></p>
  
  <pre><code>spl_autoload_register(function ($class) {
      require_once 'classes/' . $class . '.php'; 
  }); 
  </code></pre>