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

deanira's avatar

Testing ST_GeomFromGeoJSON with PHPUnit

Do any of you guys know how to test when the controller is using DB::Raw("ST_GeomFromGeoJSON('" . $request['geometry'] . "')") to input a geometry value? Because when I'm trying to test this controller I keep on getting this error:

PDOException: SQLSTATE[HY000]: General error: 1 no such function: ST_GeomFromGeoJSON in /media/deanira/TEAM-SSD/applications/drainit-testing/drainit-backend-testing/vendor/laravel/framework/src/Illuminate/Database/Connection.php:495
0 likes
3 replies
Sinnbeck's avatar

Are you sure you are using the same type of database in testing as in dev? You cannot use sqlite if you use raw

deanira's avatar

@Sinnbeck is it possible to change my database type in testing from sqlite to mysql?

Please or to participate in this conversation.