title: How to change database connection on the fly for PhpUnit tests
body: <p>I am working on a Magento 1.4.1 project, and I want to use PhpUnit to test my models.</p>
  
  <p>I am able to run my PhpUnit test using the default connection, but I want to use a different database connection than the one I use to test the interface.</p>
  
  <p>What I would like to know (if its possible):</p>
  
  <ol>
  <li>Is there a way to select a different
  connection for my models before I
  run all my tests; </li>
  <li><p>Can I just add a
  connection in my local.xml like
  this:</p>
  
  <pre><code>    &lt;phpunit_setup&gt;
          &lt;connection&gt;
              &lt;host&gt;&lt;![CDATA[localhost]]&gt;&lt;/host&gt;
              &lt;username&gt;&lt;![CDATA[username]]&gt;&lt;/username&gt;
              &lt;password&gt;&lt;![CDATA[password]]&gt;&lt;/password&gt;
              &lt;dbname&gt;&lt;![CDATA[dbname]]&gt;&lt;/dbname&gt;
              &lt;active&gt;1&lt;/active&gt;
          &lt;/connection&gt;
      &lt;/phpunit_setup&gt;
  </code></pre>
  
  <p>if yes, how do I access it.</p></li>
  </ol>
  
  <p>thanks.</p>