Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 16th, 2014  |  syntax: PHP  |  size: 0.82 KB  |  views: 55  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. namespace Madserver\Tests;
  2.  
  3. class TestCase extends \Illuminate\Foundation\Testing\TestCase {
  4.  
  5.     /**
  6.      * Default preparation for each test
  7.      */
  8.     public function setUp()
  9.     {
  10.         parent::setUp();
  11.        
  12.         $this->prepareForTests();
  13.     }
  14.  
  15.     /**
  16.      * Creates the application.
  17.      *
  18.      * @return Symfony\Component\HttpKernel\HttpKernelInterface
  19.      */
  20.     public function createApplication()
  21.     {
  22.         $unitTesting = true;
  23.  
  24.         $testEnvironment = 'testing';
  25.  
  26.         return require __DIR__.'/../../bootstrap/start.php';
  27.     }
  28.  
  29.     /**
  30.      * Migrates the database and set the mailer to 'pretend'.
  31.      * This will cause the tests to run quickly.
  32.      */
  33.     private function prepareForTests()
  34.     {
  35.         \Artisan::call('migrate');
  36.         \Mail::pretend(true);
  37.     }
  38. }
clone this paste RAW Paste Data