Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUGFIX Enforcing creation of temp database in SapphireTest->setUp() t…
…o avoid writing to production databases. This check should only kick in for single test case runs, as the temp database connection should be set in a dev/tests/all run after the first db-related test anyway. (see #5034) (from r99342) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102462 467b73ca-7a2a-4603-9d3b-597d59a354a9
- Loading branch information
43ff00e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is when you have tests that do not use the database, then I suppose
self::using_temp_db()
will return false. In other words this commit makesusesDatabase
effectively useless because the database is always created when you do not require it.43ff00e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be
if(($fixtureFile || $this->usesDatabase) && !self::using_temp_db())
If there's a fixture file or you declare you need a database and there's no temp db active....
43ff00e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uh oh, who's running test suites on production environments :/