22
33namespace Tests ;
44
5+ use Illuminate \Foundation \Application ;
56use N3XT0R \MigrationGenerator \Providers \MigrationGeneratorServiceProvider ;
67use Orchestra \Testbench \TestCase as OrchestraTestCase ;
7- use Illuminate \Foundation \Application ;
88
99abstract class TestCase extends OrchestraTestCase
1010{
@@ -13,11 +13,11 @@ abstract class TestCase extends OrchestraTestCase
1313 protected function setUp (): void
1414 {
1515 parent ::setUp ();
16- $ this ->resourceFolder = __DIR__ . '/Resources/ ' ;
16+ $ this ->resourceFolder = __DIR__ . '/Resources/ ' ;
1717 }
1818
1919 /**
20- * @param Application $app
20+ * @param Application $app
2121 * @return array|string[]
2222 */
2323 protected function getPackageProviders ($ app ): array
@@ -28,7 +28,7 @@ protected function getPackageProviders($app): array
2828 }
2929
3030 /**
31- * @param Application $app
31+ * @param Application $app
3232 * @return array
3333 */
3434 protected function getPackageAliases ($ app ): array
@@ -38,11 +38,13 @@ protected function getPackageAliases($app): array
3838 }
3939
4040 /**
41- * @param Application $app
41+ * @param Application $app
4242 */
4343 protected function getEnvironmentSetUp ($ app ): void
4444 {
45- $ app ['config ' ]->set ('database.default ' , 'mysql ' );
45+ $ host = env ('DB_HOST ' , 'db_migration ' );
46+ $ app ['config ' ]->set ('database.connections.mysql.host ' , $ host );
47+ $ app ['config ' ]->set ('database.default ' , env ('DB_CONNECTION ' , 'mysql ' ));
4648 $ app ['config ' ]->set (
4749 'database.connections.mysql ' ,
4850 [
@@ -54,5 +56,27 @@ protected function getEnvironmentSetUp($app): void
5456 'prefix ' => '' ,
5557 ]
5658 );
59+ $ app ['config ' ]->set (
60+ 'database.connections.pgsql ' ,
61+ [
62+ 'host ' => env ('DB_HOST ' , 'db_migration ' ),
63+ 'driver ' => 'pgsql ' ,
64+ 'database ' => 'testing ' ,
65+ 'username ' => env ('DB_USERNAME ' , 'postgres ' ),
66+ 'password ' => env ('DB_PASSWORD ' , '! ' ),
67+ 'prefix ' => '' ,
68+ ]
69+ );
70+ $ app ['config ' ]->set (
71+ 'database.connections.sqlsrv ' ,
72+ [
73+ 'host ' => env ('DB_HOST ' , 'db_migration ' ),
74+ 'driver ' => 'sqlsrv ' ,
75+ 'database ' => 'testing ' ,
76+ 'username ' => env ('DB_USERNAME ' , 'SA ' ),
77+ 'password ' => env ('DB_PASSWORD ' , 'Passw0rd1234! ' ),
78+ 'prefix ' => '' ,
79+ ]
80+ );
5781 }
5882}
0 commit comments