title: How to prevent Fixtures from being reloaded between tests with CakePHP and PHPUnit
body: <p>How do you prevent a CakePHP 2.0 test case, which extends <code>CakeTestCase</code> (uses PHPUnit), from reloading fixtures between tests?</p>
  
  <p><em>Background:</em> There is a set of integration tests which we have written with CakePHP 2.0 using PHPUnit. We have extended the test case class from the standard <code>CakeTestCase</code>. For this set of tests, we have a bunch of fixtures setup to populate the data from the database. Naturally, these tests take a long time to run. Basically, all of the time is coming from Cake unloading and re-loading all of the fixtures between tests.</p>
  
  <p>All of the tests act as READ only. We are just issuing find calls to the database and testing the logic among a set of class interactions based on those results. In fact, the tests can be boiled down to:</p>
  
  <pre><code>class ALongRunningTest extends CakeTestCase {
      public $fixtures = array('app.class1', 'app.class2', ... 'app.class8');
  
      /**
       * @dataProvider provider
       * @test
       */
      public function checkCompositionLogic($val1, $val2, $val3) {
          // internally calls class1 and class3
          $data = $this-&gt;ModelX-&gt;generateComplexStructure($val1);
  
          // internally calls other classes &amp; models, which touch the
          // other loaded fixtures
          $results = $this-&gt;ModelY-&gt;checkAllWhichApply($val2, $data);
  
          $this-&gt;assertEquals($val3, $results);
      }
  
      public function provider() {
          return array(
              array(stuff, stuff1, stuff2),
              array(x_stuff, x_stuff1, x_stuff2),
              array(y_stuff, y_stuff1, y_stuff2),
              array(z_stuff, z_stuff1, z_stuff2),
              array(a_stuff, a_stuff1, a_stuff2),
              // More test cases
          );
      }
  }
  </code></pre>
  
  <p>I've not been able to find anything on how to prevent this. I saw in the <code>CakeTestCase</code> class a public variable <code>autoFixtures</code> with a comment that says if you change it to <code>false</code> it won't load the fixtures. It makes a note stating that you have to load them manually. However, I see no documentation on how to actually load them manually.</p>