File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed
Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ APP_DEBUG=false
33APP_KEY=NDWgIKKi9ovNK1PXZpzfNVSBdfCXGb5i
44APP_JWT_KEY=test1234
55APP_TIMEZONE=America/Los_Angeles
6- APP_URL=http://192.168.1.249
6+ APP_URL=http://pterodactyl.local
77
88CACHE_DRIVER=file
99SESSION_DRIVER=file
@@ -19,7 +19,8 @@ APP_SERVICE_AUTHOR=testing@pterodactyl.io
1919MAIL_FROM_NAME="Pterodactyl Panel"
2020RECAPTCHA_ENABLED=false
2121
22- DB_HOST=services.pterodactyl.local
23- DB_DATABASE=panel_test
24- DB_USERNAME=panel_test
25- DB_PASSWORD=Test1234
22+ DB_CONNECTION=testing
23+ TESTING_DB_HOST=services.pterodactyl.local
24+ TESTING_DB_DATABASE=panel_test
25+ TESTING_DB_USERNAME=panel_test
26+ TESTING_DB_PASSWORD=Test1234
Original file line number Diff line number Diff line change 33namespace Pterodactyl \Tests \Browser ;
44
55use Laravel \Dusk \TestCase ;
6+ use BadMethodCallException ;
67use Tests \CreatesApplication ;
8+ use Illuminate \Database \Eloquent \Model ;
79use Facebook \WebDriver \Chrome \ChromeOptions ;
810use Facebook \WebDriver \Remote \RemoteWebDriver ;
911use Facebook \WebDriver \Remote \DesiredCapabilities ;
@@ -13,6 +15,23 @@ abstract class BrowserTestCase extends TestCase
1315{
1416 use CreatesApplication, DatabaseMigrations;
1517
18+ /**
19+ * Setup tests.
20+ */
21+ protected function setUp ()
22+ {
23+ // Don't accidentally run the migrations aganist the non-testing database. Ask me
24+ // how many times I've accidentally dropped my database...
25+ if (env ('DB_CONNECTION ' ) !== 'testing ' ) {
26+ throw new BadMethodCallException ('Cannot call browser tests using the non-testing database connection. ' );
27+ }
28+
29+ parent ::setUp ();
30+
31+ // Gotta unset this to continue avoiding issues with the validation.
32+ Model::unsetEventDispatcher ();
33+ }
34+
1635 /**
1736 * Create the RemoteWebDriver instance.
1837 *
You can’t perform that action at this time.
0 commit comments