💯 Lets not accidentally drop the entire database again.
This commit is contained in:
parent
c86690a695
commit
b50f314eda
2 changed files with 25 additions and 5 deletions
|
@ -3,7 +3,9 @@
|
|||
namespace Pterodactyl\Tests\Browser;
|
||||
|
||||
use Laravel\Dusk\TestCase;
|
||||
use BadMethodCallException;
|
||||
use Tests\CreatesApplication;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Facebook\WebDriver\Chrome\ChromeOptions;
|
||||
use Facebook\WebDriver\Remote\RemoteWebDriver;
|
||||
use Facebook\WebDriver\Remote\DesiredCapabilities;
|
||||
|
@ -13,6 +15,23 @@ abstract class BrowserTestCase extends TestCase
|
|||
{
|
||||
use CreatesApplication, DatabaseMigrations;
|
||||
|
||||
/**
|
||||
* Setup tests.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
// Don't accidentally run the migrations aganist the non-testing database. Ask me
|
||||
// how many times I've accidentally dropped my database...
|
||||
if (env('DB_CONNECTION') !== 'testing') {
|
||||
throw new BadMethodCallException('Cannot call browser tests using the non-testing database connection.');
|
||||
}
|
||||
|
||||
parent::setUp();
|
||||
|
||||
// Gotta unset this to continue avoiding issues with the validation.
|
||||
Model::unsetEventDispatcher();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the RemoteWebDriver instance.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue