title: How Do I Seed My Database in the setupBeforeClass Method in a Laravel 4 Unit Test?
body: <p>I have a Laravel 4 test class with some tests for which I want to seed my database before running the tests.  Using the setup() function to reseed for each test takes far too long.  However, when I try seeding in the static setupBeforeClass() function or the constructor, I obviously can't use the $this->seed() method.  </p>
  
  <p>But neither can I use programmatic Artisan commands, because when I do, I get the following error:  <code>PHP Fatal error:  Class 'Artisan' not found in &lt;test class name&gt;.</code></p>
  
  <p>Here is the code I'd like to use to seed:</p>
  
  <pre><code>Artisan::call('migrate:refresh');
  Artisan::call('db:seed', array('--class'=&gt;'TestSeeder');
  </code></pre>
  
  <p>Please let me know how I can seed my database once per test <em>class</em> rather than per test <em>case</em></p>