Created
December 11, 2018 12:13
-
-
Save devmsh/5d57886b0a7c4d93e8ec8c808b72d475 to your computer and use it in GitHub Desktop.
TestCase migrate
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 | |
| abstract class TestCase extends BaseTestCase | |
| { | |
| const DATABASE_MIGRATIONS_USER = "database/migrations/user"; | |
| /** | |
| * @param $path | |
| */ | |
| public function migrate($path) | |
| { | |
| foreach (array_wrap($path) as $key => $path) { | |
| $migrateCommand = $key == 0 ? "migrate:fresh" : "migrate"; | |
| Artisan::call($migrateCommand, [ | |
| "--path" => $path, | |
| ]); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment