Ticket #183 (closed defect: fixed)
Unit tests don't work with SQLite
| Reported by: | michaeltwofish | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.6 |
| Component: | Habari Core Software | Version: | SVN |
| Keywords: | testing, SQLite, has_patch | Cc: |
Description
The connection string for SQLite in config.php specifies a relative path to the database. This works when Habari is launched from it's main directory, but the unit test framework requires that Habari is launched from the tests directory, and therefore the database is not found. A manual workaround is to change the connection string to an absolute path, but a better fix needs to be implemented.
Attachments
Change History
comment:1 Changed 4 years ago by michaeltwofish
- Keywords testing, SQLite added
- Component changed from -none- to Habari Core Software
- Milestone changed from 0.5 to Undetermined
comment:2 Changed 4 years ago by michaeltwofish
An alternative workaround is to specify a full path when installing through the install form.
Is that enough and we close this ticket? Or should we store the full path to the SQLite DB in config.php?
comment:3 Changed 4 years ago by rickc
The attached patch will get the unit tests to work with SQLite without having to change your config.php file. I've tested it with absolute paths, just the name of the database file, and paths relative to the Habari base installation in the connection string. All seem to work okay.

