Created
September 4, 2015 10:11
-
-
Save thijsvdanker/ec1ef6defe34d903f089 to your computer and use it in GitHub Desktop.
Creates a trait to be used in tests that don't want the whole multi-tenant setup.
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 | |
/** | |
* @file | |
* Contains tests\helpers\TenantMigrations | |
*/ | |
namespace tests\helpers; | |
trait TenantMigrations | |
{ | |
/** | |
* @before | |
*/ | |
public function beginTenantMigrations() | |
{ | |
putenv('TENANT_CONNECTION=mysql'); | |
$this->artisan('migrate', ['--path' => 'database/tenant_migrations/']); | |
$this->beforeApplicationDestroyed(function () { | |
$this->artisan('migrate:rollback'); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment