Skip to content

Instantly share code, notes, and snippets.

@kbirmhrjn
Created January 6, 2014 07:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kbirmhrjn/8279618 to your computer and use it in GitHub Desktop.
Save kbirmhrjn/8279618 to your computer and use it in GitHub Desktop.
TestCase
<?php
class TestCase extends Illuminate\Foundation\Testing\TestCase {
/**
* Creates the application.
*
* @return Symfony\Component\HttpKernel\HttpKernelInterface
*/
public function createApplication()
{
$unitTesting = true;
$testEnvironment = $this->testEnvironment;
return require __DIR__.'/../../bootstrap/start.php';
}
public function setTestEnvironment($testEnvironment)
{
$this->testEnvironment = $testEnvironment;
}
public function setUp($testEnvironment='local')
{
if($testEnvironment)
$this->setTestEnvironment($testEnvironment);
parent::setUp();
if($this->testEnvironment == 'testing'){
new Tests\Lib\PrepareDb;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment