Skip to content

Instantly share code, notes, and snippets.

@gayanhewa
Forked from kbirmhrjn/TestCase.php
Created June 24, 2014 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gayanhewa/c346a65d80e9ae9eaaca to your computer and use it in GitHub Desktop.
Save gayanhewa/c346a65d80e9ae9eaaca to your computer and use it in GitHub Desktop.
<?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