2
votes
Accepted
Overwrite the global database driver
You can set the database driver, just not with any simple function (that I know of), such as setDbo.
If you look at the Joomla Database Framework package:
use Joomla\Database;
class MyApplication ...
1
vote
Accepted
How do I unit test component methods that use the logger?
In the end I didn't find a way to do this through mocking, but it is very simple to implement a class that does everything I need from the logger:
class JLog {
const DEBUG = 5;
const INFO = 4;...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
unit-testing × 5joomla-3.x × 2
php × 1
plugin × 1
custom-component × 1
database × 1
joomla-4.x × 1
jfactory × 1
logs × 1
troubleshooting × 1
docker × 1