-
-
Save gayanhewa/c346a65d80e9ae9eaaca to your computer and use it in GitHub Desktop.
This file contains 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