diff options
author | Kate Butler <kate@innocraft.com> | 2019-08-05 05:45:17 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2019-08-05 05:45:17 +0300 |
commit | 2aa7c822b17e62dfde9fd2cd4c608e5a6e71d439 (patch) | |
tree | c38a76f863901bb1f9855b2effe1c045b4ef9ded /plugins/TestRunner/Commands/TestsSetupFixture.php | |
parent | 6a6af0cb53322e93aa5f3c633aeff2a19454629b (diff) |
Prevent test fixture setup/teardown from touching non-test database (#14729)
Diffstat (limited to 'plugins/TestRunner/Commands/TestsSetupFixture.php')
-rw-r--r-- | plugins/TestRunner/Commands/TestsSetupFixture.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/TestRunner/Commands/TestsSetupFixture.php b/plugins/TestRunner/Commands/TestsSetupFixture.php index 4321234f93..1df6f47bb7 100644 --- a/plugins/TestRunner/Commands/TestsSetupFixture.php +++ b/plugins/TestRunner/Commands/TestsSetupFixture.php @@ -108,9 +108,13 @@ class TestsSetupFixture extends ConsoleCommand $_SERVER = json_decode($serverGlobal, true); } + // Tear down any DB that already exists + Db::destroyDatabaseObject(); + if(Config::getInstance()->database_tests['tables_prefix'] !== '') { throw new \Exception("To generate OmniFixture for the UI tests, you must set an empty tables_prefix in [database_tests]"); } + $this->requireFixtureFiles($input); $this->setIncludePathAsInTestBootstrap(); |