Summer Sale! All accounts are 50% off this week.

Moseskamau338's avatar

#Tenancyforlaravel Testing database setup

For my multi-tenant application, I chose to go with the tenancyforlaravel package and use a database per tenant architecture. Setup is good and the tenant registration works fine.

The problem is I want to write tests. for my application but I cant. I followed this guide in the docs but with no avail. I keep getting this error:

[docker://laravelsail/php81-composer:latest/]:php /opt/project/vendor/phpunit/phpunit/phpunit --configuration /opt/project/phpunit.xml --filter "/(Tests\Feature\TenantTests\TestTenancy::test_that_case_extends_tenancy_successfully)( .*)?$/" --test-suffix TestTenancy.php /opt/project/tests/Feature/TenantTests --teamcity
Testing started at 21:22 ...
PHPUnit 9.5.20 #StandWithUkraine


Illuminate\Database\QueryException : could not find driver (SQL: SHOW FULL TABLES WHERE table_type = 'BASE TABLE')
 /opt/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php:742
 /opt/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php:702
 /opt/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php:404
....

I know I haven't set up the database correctly but am not sure how. There's not much to glean on the docs regarding this issue. Am just a beginner t testing and this is just discouraging. Please help

0 likes
0 replies

Please or to participate in this conversation.