title: phing and phpunit + bootstrap
body: <p>How to run PHPUnit test suite with bootstrap file with phing?</p>
  
  <p>My app structure:</p>
  
  <pre><code>application/
  library/
  tests/
    application/
    library/
    bootstrap.php
    phpunit.xml
  build.xml
  </code></pre>
  
  <p>phpunit.xml:</p>
  
  <pre><code>&lt;phpunit bootstrap="./bootstrap.php" colors="true"&gt;
      &lt;testsuite name="Application Test Suite"&gt;
          &lt;directory&gt;./&lt;/directory&gt;
      &lt;/testsuite&gt;
      &lt;filter&gt;
          &lt;whitelist&gt;
              &lt;directory
                suffix=".php"&gt;../library/&lt;/directory&gt;
              &lt;directory
                suffix=".php"&gt;../application/&lt;/directory&gt;
              &lt;exclude&gt;
                  &lt;directory
                    suffix=".phtml"&gt;../application/&lt;/directory&gt;
              &lt;/exclude&gt;
          &lt;/whitelist&gt;
      &lt;/filter&gt;
  &lt;/phpunit&gt;
  </code></pre>
  
  <p>then:</p>
  
  <pre><code>cd /path/to/app/tests/
  phpunit
  #all test passed
  </code></pre>
  
  <p>But how do I run the tests from <code>/path/to/app/</code> dir? The problem is, that the <code>bootstrap.php</code> depends on relative paths to library and application. </p>
  
  <p>If I run <code>phpunit --configuration tests/phpunit.xml /tests</code> I got a bunch of file not found errors.</p>
  
  <p>How do I write <code>build.xml</code> file for <code>phing</code> to run the tests the same way <code>phpunit.xml</code> does?</p>