<p>I'm a longtime Java programmer working on a PHP project, and I'm trying to get PHPUnit up and working.  When unit testing in Java, it's common to put test case classes and regular classes into separate directories, like this -</p>

<pre><code>/src  
  MyClass.java

/test  
  MyClassTest.java
</code></pre>

<p>and so on.</p>

<p>When unit testing with PHPUnit, is it common to follow the same directory structure, or is there a better way to lay out test classes?  So far, the only way I can get the "include("MyClass.php")" statement to work correctly is to include the test class in the same directory, but I don't want to include the test classes when I push to production.</p>

You need to modify PHP's include_path so that it knows where to find MyClass.php when you
```
include()
```
it in your unit test.
You could have something like this at the top of your test file (preceding your include):
```
```
set_include_path(get_include_path() . PATH_SEPARATOR . "../src");
```
```
This appends your
```
src
```
directory onto the include path and should allow you to keep your real code separate from your test code.