title: Can't extend PHPUnit_Extensions_Database_TestCase
body: <p>I had become totally convinced about TDD and trying to use it by the book, looking forward to have a near to 100% test coverage and always writing tests before new coding.</p>
  
  <p>I'm using phpUnit over ZF and although I can feel some progress somedays, in others I feel like I'm totally stuck.</p>
  
  <p>My application is very database centric and I am in need to begin to test (and code...) database persistence.</p>
  
  <p>I was taking a look at slides from <a href="http://en.oreilly.com/mysql2011/public/schedule/detail/16813" rel="nofollow">Testing Lamp Appplications Presentation by Stephenn Bergmann</a> and it seems very clear and straightforward how to test database interaction.</p>
  
  <p>But, always I try to use a class that extends PHPUnit_Extensions_Database_TestCase I have error messages about not finding some class at 'PHPUnit_Extensions_Database' namespace.</p>
  
  <p>Probably I´m missing some crucial point, as I have the same problem when I try to follow any of others solutions and suggestions I can find, like an answer and a presentation that I can't link here because of my reputation...</p>
  
  <p>In all cases, when I extends Database_TestCase, some class is not found.</p>
  
  <p>I suspect that there is something related with the way I'm bootstraping, but I can't find what I'm doing wrong. The tests I wrote that extend ControllerTestCase work well.</p>
  
  <p>I'm running over Xampp. phpUnit version os 3.6.10, php is 5.3.8, Zend Framework is 1.11.11</p>
  
  <p>I'm using the following phpunit.xml as php configuration:</p>
  
  <pre><code>&lt;phpunit bootstrap="./application/bootstrap.php" colors="true"&gt;
  &lt;testsuite name="Some"&gt;
      &lt;directory&gt;./&lt;/directory&gt;
  &lt;/testsuite&gt;
  
  &lt;filter&gt;
      &lt;whitelist&gt;
          &lt;directory suffix=".php"&gt;../application/&lt;/directory&gt;
          &lt;directory suffix=".php"&gt;../library/MyApp/&lt;/directory&gt;
          &lt;exclude&gt;
              &lt;directory suffix=".phtml"&gt;../application/&lt;/directory&gt;
              &lt;file&gt;../application/Bootstrap.php&lt;/file&gt;
              &lt;file&gt;../application/modules/default/controllers/ErrorController.php&lt;/file&gt;
          &lt;/exclude&gt;
      &lt;/whitelist&gt;
  &lt;/filter&gt;
  
  &lt;logging&gt;
      &lt;log type="coverage-html" target="./log/report" charset="UTF-8" yui="true" hightlight="true" lowupperbound="50" highlowerbound="80"&gt;
      &lt;log type="testdox" target="./log/testdox.html"&gt;
  &lt;/log&gt;&lt;/log&gt;&lt;/logging&gt;
  </code></pre>
  
  <p></p>
  
  <p>My Bootstrap.php is:</p>
  
  <pre><code>    error_reporting(E_ALL | E_STRICT);
  
  // Define path to application directory
  defined('APPLICATION_PATH')
      || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application'));
  
  // Define application environment
  defined('APPLICATION_ENV')
      || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'testing'));
  
  // Ensure library/ is on include_path
  set_include_path(implode(PATH_SEPARATOR, array(
      realpath(APPLICATION_PATH . '/../library'),
      get_include_path(),
  )));
  
  require_once 'Zend/Application.php';
  require_once 'ControllerTestCase.php';
  </code></pre>
  
  <p>and ControllerTestCase.php</p>
  
  <pre><code>require_once 'Zend/Application.php';
  require_once 'Zend/Test/PHPUnit/ControllerTestCase.php';
  class ControllerTestCase extends Zend_Test_PHPUnit_ControllerTestCase
  {
      /**
       * @var Zend_Application
      */
      protected $application;
  
      public function setUp() {
          $this-&gt;bootstrap = array($this, 'appBootstrap');
          parent::setUp();
      }
  
      public function appBootstrap() {
          $this-&gt;application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
          $this-&gt;application-&gt;bootstrap();
      }
  }
  </code></pre>
  
  <p>And when I create a Test as, for exemple, this tryTest.php</p>
  
  <pre><code>    require_once 'PHPUnit/Extensions/Database/TestCase.php';
  
  class TryTest extends PHPUnit_Extensions_Database_TestCase {
      /*** any test or even just getConnection ***/
  }
  </code></pre>
  
  <p>I receive the following error message or something close to it in other ways I try:</p>
  
  <blockquote>
    <blockquote>
      <p>Fatal error: Class 'PHPUnit_Extensions_Database_DefaultTester' not found in C:\xampp\php\PEAR\PHPUnit\Extensions\Database\TestCase.php on
      line 132</p>
    </blockquote>
    
    <p>Call Stack:
        0.0003     326968   1. {main}() C:\xampp\php\phpunit:0
        0.0141     745152   2. PHPUnit_TextUI_Command::main() C:\xampp\php\phpunit:46
        0.0141     745568   3. PHPUnit_TextUI_Command->run() C:\xampp\php\PEAR\PHPUnit\TextUI\Command.php:130
        0.4012    5280032   4. PHPUnit_TextUI_TestRunner->doRun() C:\xampp\php\PEAR\PHPUnit\TextUI\Command.php:192
        0.7182    5750296   5. PHPUnit_Framework_TestSuite->run() C:\xampp\php\PEAR\PHPUnit\TextUI\TestRunner.php:325
        2.4058   11441872   6. PHPUnit_Framework_TestSuite->run() C:\xampp\php\PEAR\PHPUnit\Framework\TestSuite.php:705
        2.4060   11442104   7. PHPUnit_Framework_TestSuite->runTest() C:\xampp\php\PEAR\PHPUnit\Framework\TestSuite.php:745
        2.4060   11442104   8. PHPUnit_Framework_TestCase->run() C:\xampp\php\PEAR\PHPUnit\Framework\TestSuite.php:772
        2.4061   11442104   9. PHPUnit_Framework_TestResult->run() C:\xampp\php\PEAR\PHPUnit\Framework\TestCase.php:751
        2.4066   11441136  10. PHPUnit_Framework_TestCase->runBare() C:\xampp\php\PEAR\PHPUnit\Framework\TestResult.php:649
        2.4079   11494800  11. PHPUnit_Extensions_Database_TestCase->setUp()
    C:\xampp\php\PEAR\PHPUnit\Framework\TestCase.php:801
        2.4080   11494832  12. PHPUnit_Extensions_Database_TestCase->getDatabaseTester()
    C:\xampp\php\PEAR\PHPUnit\Extensions\Database\TestCase.php:202
        2.4080   11494832  13. PHPUnit_Extensions_Database_TestCase->newDatabaseTester()
    C:\xampp\php\PEAR\PHPUnit\Extensions\Database\TestCase.php:92</p>
  </blockquote>
  
  <p>There is a DefaultTester.php at C:\xampp\php\PEAR\PHPUnit\Extensions\Database and I can't figure out what is going on...</p>
  
  <p>I got to this configuration after following this [Zendcast from Jon Lebensold][2]. At that moment, I had some hard times trying to solve some problems, but after some help from @edorian I found that the main problem was between my chair and keyboard... :-/ Probably same situation now...</p>
  
  <p>I even tryed to create a MapperTestCase in a similar way as Jon built his ControllerTestCase.php file, but this didn't help me anyhow.</p>
  
  <p>So, now I'm here, trying to get some help to find what is wrong with my environment or approach.</p>