Created
January 6, 2014 07:55
-
-
Save kbirmhrjn/8279618 to your computer and use it in GitHub Desktop.
TestCase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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