Answer the question
In order to leave comments, you need to log in
How to test laravel phpunit with sqlite (swears by syntax errors)?
Hello everyone, friends.
Can you tell me how sqlite is sometimes used for phpunit testing in laravel, if the syntaxes of mysql and sqlite, if I understand correctly, are not fully compatible?
for example, I get this error:
error: 1 near "comment": syntax error (SQL: ALTER TABLE `accounts` comment 'Users table')
Here is the query:
ALTER
TABLE `accounts` comment 'Users and privileges table'
I didn’t understand it right?)
Thank you very much for the answers)
Answer the question
In order to leave comments, you need to log in
Obviously, sqlite is not used for testing in any way, if in reality a different database engine is used. Create a test database and test in it.
Either change the driver for the test environment and use only migrations and ORM mechanisms without raw queries (or check that their syntax is normally understood by sqlite). But it is no less obvious, tying oneself hand and foot.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question