Browse AI Field GuideForum Podcast
All ThreadsLeaderboard
  1. Discussions

    1. Popular This Week
    2. Popular All Time
    3. Solved
    4. Unsolved
    5. No Replies Yet

Ngozistephen's avatar

SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: bookings.start_date

I am getting this error message in my test. How can i solve this error SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: bookings.start_date (Connection: sqlite, SQL: insert into "booking s" ("apartment_id", "user_id", "total_price", "updated_at", "created_at") values (1, 2, 0, 2023-05-29

Ngozistephen's avatar
Ngozistephen's avatar Tray23yrs agoLaravel
6
1
Last reply by Tray2 3yrs ago
NotSteve's avatar

How to start testing on existing API Endpoint?

Hi, I want to expand my skillset and finally learn testing using PHPUnit. I have been reading and doing some simple tutorials such as this. I currently have a small Laravel project where essentially it is just an API Endpoint that uses SQLite. It receives data through a python script hosted on a different platform than where the API is. This means the API Endpoint receives data

NotSteve's avatar
NotSteve's avatar LaryAI3yrs agoTesting
1
1
Last reply by LaryAI 3yrs ago
jimmyhowedotcom's avatar

Error while running basic unit test

⨯ it can create stripe credentials 1.16s ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── FAILED Tests\Unit\CompanyStripeAccountTest > it can

jimmyhowedotcom's avatar
jimmyhowedotcom's avatar jimmyhowed...3yrs agoTesting
0
1
radhamadhavamhostel's avatar

Spatie laravel permission. tables are not migrating in Laravel 10

Hi, I am using spatie laravel roles and permission package in Laravel 10. I am using UUID insted of id. But migration fails <?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; use Spatie\Permission\PermissionRegistrar; class CreatePermissionTables extends Migration { /** * Run the mi

radhamadhavamhostel's avatar
radhamadhavamhostel's avatar psrz3yrs agoLaravel
6
2
Last reply by psrz 3yrs ago
lentichin's avatar

What can I do to increase the stability of a Laravel application running off SD cards?

Hi, I was wondering if anyone has experience deploying a Laravel application that is running off an SD card. Right now we have these routers that have an SD card slot and run linux. Because of this we have managed to put a Laravel application on the SD card. The Laravel application uses SQLite, as well as local storage, to serve audio and images with a total single user experie

lentichin's avatar
lentichin's avatar Snapey3yrs agoLaravel
1
1
Last reply by Snapey 3yrs ago
CamKem's avatar

Help setting up Test checks.

Hi, I am in the process of learning TDD & I have set up an .env.testing file so that I can use sqlite for the testing db. This was all working fine, but I have a problem with one of my tests, I am trying to Test user unlikes an article, using a pivot table (polymorphic relationship). This is the test: public function test_a_post_can_be_unliked() { // create

CamKem's avatar
CamKem's avatar CamKem3yrs agoLaravel
2
1
Last reply by CamKem 3yrs ago
Ruben3020's avatar

After upgrade from 6 -> 7

I've upgraded with below composer.json but when running php artisan optimize i get this: PHP Warning: require(/var/www/myproject_dev2/myproject/vendor/composer/../../src/Illuminate/Foundation/helpers.php): failed to open stream: No such file or directory in /var/www/myproject_dev2/myproject/vendor/composer/autoload_real.php on line 41 PHP Fatal error: require(): Failed openin

Ruben3020's avatar
Ruben3020's avatar jlrdw3yrs agoLaravel
3
1
Last reply by jlrdw 3yrs ago
alexhackney's avatar

Best way to deploy .env to temporary server

As part of my app I need to spin up a separate transcoding server. I've got it all up and running fine but I'd like to utilize a minimal Laravel install on that server to manage api requests in and out of the server. I was thinking about either using sqlite db to manage the server or maybe giving access to the main db via a temporary username/password and of course whitelisting

alexhackney's avatar
alexhackney's avatar alexhackne...3yrs agoServers
2
1
Last reply by alexhackney 3yrs ago
mstdmstd's avatar

I got “There is no active transaction” error after I added RefreshDatabase into test file

Making in laravel 9.48.0 with mysql database http tests after I added RefreshDatabase into test file use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\Artisan; use Illuminate\Foundation\Testing\Concerns\InteractsWithExceptionHandling; use Tests\TestCase; use App\Models\{Article, User}; use Illuminate\Support\Str; class ArticlesCrudTest extends

mstdmstd's avatar
mstdmstd's avatar laracoft3yrs agoTesting
7
1
Last reply by laracoft 3yrs ago
naghal's avatar

RefreshDatabase trait with sql server

I am trying to use a real Sql Server connection to run my php unit test in Laravel because SqLite does not have the function I am trying to test. The database name is "Test" and the connection details have all been added to database.php. I have changed my phpunit.xml env variables to refer to the new test database. <env name="DB_CONNECTION" value="te

naghal's avatar
naghal's avatar omer_hamza3yrs agoTesting
8
1
Last reply by omer_hamza 3yrs ago
Surman's avatar

Sync between Laravel app and an android app

I'm currently synchronizing an android app that internally uses a SQLite database with my Laravel web (using MySQL), with each POST from the android app I receive a timestamp ($request_timestamp) and JSON with records data to update/insert my Laravel Appp at the same time I return a JSON with the collections that needs to synchronize to the android app side, filtered by a time

Surman's avatar
Surman's avatar Surman3yrs agoDesign
2
4
Last reply by Surman 3yrs ago
felixele217's avatar

Prevent Forge Quick Deploy on GitHub Actions Fail

Hey guys, how can I prevent the Quick Deploy if GitHub Actions Fail? My GitHub Actions laravel.yml is currently this: name: Laravel on: push: branches: [ "main" ] pull_request: branches: [ "main" ] jobs: laravel-tests: runs-on: ubuntu-latest steps: - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e wit

felixele217's avatar
felixele217's avatar felixele21...3yrs agoLaravel
0
1
NotSteve's avatar

Laravel App using Docker not able to connect to MySQL Server

I am using Docker to build my application. I've been using sqlite recently, but I want to move on to MySQL. The issue that I am having is that my application cannot connect to the local MySQL server. I keep getting this response: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) I have checked my files, and I am sure that

NotSteve's avatar
NotSteve's avatar sgfanega3yrs agoGeneral
2
1
Last reply by sgfanega 3yrs ago
bor1904's avatar

How to handle testing DB data setup in new project

Hello Guys, We always in team have problem how to set DB data for whole team to be ok and simple. (we dont use dockers and sqlite in memory) For now we are adding "testing" connection in config.database: (...) 'host' => env('DB_TEST_HOST', 'localhost'), 'database' => env('DB_TEST_DATABASE', 'testdb'), 'usernam

bor1904's avatar
bor1904's avatar Tray23yrs agoTesting
10
1
Last reply by Tray2 3yrs ago
julianov's avatar

Oracle xe db issue

Hello. I've a docker compose with an oracle xe db image: hostname: localhost port: 49161 sid: xe username: system password: oracle So, I the .env file I set: DB_CONNECTION=oracle DB_HOST=localhost DB_PORT=49161 DB_DATABASE=portalCiudadano DB_USERNAME=system DB_PASSWORD=oracle and in database.php 'oracle' => [ 'driver' => 'oracle', 'host' => env('ORACLE_HOST',

julianov's avatar
julianov's avatar mooh3yrs agoCode Review
1
1
Last reply by mooh 3yrs ago
shawnveltman's avatar

Testing Workflow Speedup

Context I'm currently working on a few projects with large-ish test suites (1500 - 3500), and prefer to use the same database for my tests as I do in prod (I've been bitten a few times by tests that pass, but cause failures in prod due to differences between SQLite & Mysql/Mariadb) Problem As the projects grow over the years, even doing database squashes on a regular basis

shawnveltman's avatar
shawnveltman's avatar shawnveltm...3yrs agoTips
0
1
Rretzko's avatar

Testing truncates MySql database

Hi - I'm early in my learning TDD. I've set up my testing environment to use the in-memory sqlite database, but when I run my tests, the actual MySql database gets wiped out as well. Any thoughts on what I can look for that is triggering this? Here's the phpunit.xml file: <?xml version="1.0" encoding="UTF-8"?> <phpunit xmlns:xsi="http://www.w

Rretzko's avatar
Rretzko's avatar Rretzko3yrs agoTesting
6
1
Last reply by Rretzko 3yrs ago
larswoltersdev's avatar

GitHub actions pipeline failing, but not locally

Hi all, I'm trying to get a pipeline on GitHub actions working, but for some reason, I get 403 errors but not locally. These are the errors (I use Pest PHP for testing): • Tests\Feature\Endpoints\EndpointTest > an endpoint detail page can be viewed when authenticated PHPUnit\Framework\ExceptionWrapper This action is unauthorized. at vendor/laravel/framework/src/I

larswoltersdev's avatar
larswoltersdev's avatar Nakov3yrs agoLaravel
1
1
Last reply by Nakov 3yrs ago
frknasir's avatar

Method Illuminate\Database\SQLiteConnection::isMaria does not exist.

Any knows why I might getting this error while running tests in my Laravel application using Pest framework. I am using sqlite db instead of mysql. All other tests are working except the ones that involve me creating models with this two factories: EntityFactory.php <?php namespace Database\Factories; use App\Models\Address; use App\Models\Entity; use Illuminate\Database\E

frknasir's avatar
frknasir's avatar frknasir3yrs agoLaravel
6
1
Last reply by frknasir 3yrs ago
L0GAN's avatar

Dusk Writes to Correct DB but Reads from Wrong DB

I am using Dusk for browser testing. My testing database is an sqlite file (dusk.sqlite); I use mysql for the actual database. During testing, I have no issues connecting and seeding the correct database (sqlite) but whenever the application needs to read from the database, it defaults to the mysql instance instead of the sqlite file. For instance, it will properly seed a user

L0GAN's avatar
L0GAN's avatar L0GAN3yrs agoTesting
1
1
Last reply by L0GAN 3yrs ago
alnahian2003's avatar

$table->after() not working in database migration!

Hey, I'm running a latest laravel 9 application on my local machine. According to the official db migrations doc , I can move a column of a table using the after() method. Currently I have a posts table in my sqlite3 database and I want to add a new column named 'views' in it. So I normally ran the migration command and in the migration file, I added $table->bigInteger('vie

alnahian2003's avatar
alnahian2003's avatar Snapey3yrs agoLaravel
7
52
Last reply by Snapey 3yrs ago
BernardoBF4's avatar

Set database for testing

I am currently trying to run a test and I get the error SQLSTATE[HY000] [2002] Connection refused. I have not changed any configuration in my config/database.php or phpunit.xml. I believe that the main point here is to decide the best strategy for TDD. I want to use mysql and not sqlite, because I believe that having the real environment an advantage, but I don't know if can us

BernardoBF4's avatar
BernardoBF4's avatar Sinnbeck3yrs agoTesting
2
1
Last reply by Sinnbeck 3yrs ago
MahmoudAdelAli's avatar

utf8mb4 Collection Error when excute query

hello , after i deploy the app to heroku and run migrations when i login in i got the following error SQLSTATE[42000]: Syntax error or access violation: 1253 COLLATION 'utf8mb4_unicode_ci' is not valid for CHARACTER SET 'utf8mb3' select * from `users` where `username` = developer limit 1 and the part of error $request->merge([ $user_id => $request->log

MahmoudAdelAli's avatar
MahmoudAdelAli's avatar RayC3yrs agoLaravel
3
1
Last reply by RayC 3yrs ago
heitorcto's avatar

Connection with multiple database where the second is randomic

Hi guys, today i have two connectios, first in mysql and the second in sqlite, but the second one is randomic, because is correspond an email DB, and in my server i have a folter to each mail and each mail have a connection, a new DB connection, how i can make a randomic connecion with sqlite, i think i can not use the .env settings becouse the database is not one, someone can

heitorcto's avatar
heitorcto's avatar heitorcto3yrs agoCode Review
0
1
ByteSolution's avatar

PHPUnit Test fails with error message: undefined array key -1

Hi all, after I did a composer update, all my tests are failing. The error message I get is as follows: • Tests\Feature\ProtocolTest > index can be rendered ErrorException Undefined array key -1 at vendor/doctrine/dbal/src/Schema/SqliteSchemaManager.php:605 601▕ $foreignKeyCount = count($foreignKeyDetails); 602▕ 603▕ foreach ($columns

ByteSolution's avatar
ByteSolution's avatar nielsnl3yrs agoLaravel
2
1
Last reply by nielsnl 3yrs ago
PeterF's avatar

Unit testing DB

Hi All. Just wondering if I have missed something..... I am running MySQL for production, and needed to do a quick fix, which meant I added a new Scope with a ->whereRaw("DATE_FORMAT(entry_time, '%r') < ?", [$end]); which is fine.... but then I went back to write some unit tests to complete the loop (not quite TDD, more DDT)... and eventually worked out my new

PeterF's avatar
PeterF's avatar Sinnbeck3yrs agoTesting
3
1
Last reply by Sinnbeck 3yrs ago
PetroGromovo's avatar

Why running tests main mysql database is currupted ?

Working with mysql in laravel 8 app I make tests with controller: <?php namespace Tests\Feature; use Illuminate\Foundation\Testing\DatabaseMigrations; use Tests\TestCase; class ItemsController extends TestCase { use DatabaseMigrations; /** @test */ public function index_test() { ... and having “sqlite” in phpunit.xml: <?xml version="1.0&

PetroGromovo's avatar
PetroGromovo's avatar Sinnbeck3yrs agoTesting
2
1
Last reply by Sinnbeck 3yrs ago
mathewparet's avatar

Git error when adding sail to project

I am trying to migrate a project from Laravel 7 to 8 (and finally to 9). And I wish to use the sail features in dev. I followed the upgrade steps and the steps to install sail as defined here https://laravel.com/docs/8.x/sail#installation When I try sail up everything looks fine and the site is rendered. But when I try to run sail artisan migrate or sail artisan tinker or virtu

mathewparet's avatar
mathewparet's avatar mathewpare...4yrs agoLaravel
1
1
Last reply by mathewparet 4yrs ago
Moseskamau338's avatar

Laravel Multi-database PHPUnit Setup

So I have a brand new Laravel app, spiced with the default Breeze scaffolding(Inertia). I want to create a mult-tenant (with multiple DBs setup) application using Spatie's multi-tanancy package. On my routes/web.php i have this testing route: //... Route::get('/test_tenancy', function () { $tenant = \App\Models\PosTenant::create([ 'name' => 'Mash',

Moseskamau338's avatar
Moseskamau338's avatar Moseskamau...4yrs agoTesting
0
1
CLab's avatar

Run different migration in test

I have a migration which is altering a column in a table in Postgres (dev) to JSON. This is a custom query like. DB::statement('ALTER TABLE users ALTER COLUMN options TYPE JSON USING (options)::json'); However due to this migration my tests are failing as I am using SQLite in testing. How can I run a different alteration command for test vs dev? I am looking for so

CLab's avatar
CLab's avatar CLab4yrs agoTesting
6
1
Last reply by CLab 4yrs ago
Eddie D's avatar

Migrate new test DB => Database(x) does not exist

I've been developing tests in my "production" mysql database(app is unreleased) and realize I should have a separate test database so setting one up now. I'm following the Laracast on how to set up a test sqlite database, but it's not working I'm getting the error: eddie@production:~/projects/production2.0$ php artisan migrate --database=sqlite_testing ***************

Eddie D's avatar
Eddie D's avatar tykus4yrs agoLaravel
5
1
Last reply by tykus 4yrs ago
alberto98's avatar

Error with Laravel Policies and Laravel Github Action

Hi everybody, I'm currently working on a OpenSource Laravel API that will support the communication between personal trainers and their athletes. For the first time, I'm trying using the Laravel GitHub action with the default configuration. This is how the yml file look like: name: Laravel on: push: branches: [ main ] pull_request: branches: [ main ] jobs: larav

alberto98's avatar
alberto98's avatar alberto984yrs agoTesting
6
1
Last reply by alberto98 4yrs ago
PlasticHeart's avatar

How do I make my container sync the files I make? (docker)

I'm making a web application but I want to develop it in docker, but when I am using my container, the container files are not synchronized with the ones that are shown in the text editor, how can I solve that? The files that are not synchronized are, for example, the migrations or the composer.json, that is, when I install a package through composer, those changes are not refl

PlasticHeart's avatar
PlasticHeart's avatar Sinnbeck4yrs agoLaravel
9
1
Last reply by Sinnbeck 4yrs ago
SiL3NC3's avatar

How to setup Laravel and Laragon using sendmail.exe on windows

OS: Windows 10 Laravel Version: 8.75 PHP Version: 7.4.27 Database Driver & Version: sqlite Description: I trying around getting sendmail (Laragon) to work, but without luck. File '.env' got adjusted to use sendmail instead of smtp on a fresh laravel project. Steps To Reproduce: created new laravel project laravel new test adjusted .env file: MAIL_MAILER=sendmail MAIL

SiL3NC3's avatar
SiL3NC3's avatar SiL3NC34yrs agoLaravel
0
1
kenprogrammer's avatar

Tests run on development database instead of testing database

Here is my setup: database.php 'default' => env('DB_CONNECTION', 'mysql'), 'connections' => [ 'sqlite' => [ 'driver' => 'sqlite', 'url' => env('DATABASE_URL'), 'database' => env('DB_DATABASE', database_path('database.sqlite')), 'prefix' => '', 'foreign_key_constraints' => env('DB_FOREIG

kenprogrammer's avatar
kenprogrammer's avatar kenprogram...4yrs agoTesting
5
1
Last reply by kenprogrammer 4yrs ago
mozew's avatar

Unsupported driver [file].

I am facing the issue of the unsupported driver while hitting my API I have the following configurations in my config/database.php <?php use Illuminate\Support\Str; return [ /* |-------------------------------------------------------------------------- | Default Database Connection Name |-------------------------------------------------------------------------- | |

mozew's avatar
mozew's avatar dpelto4yrs agoLaravel
24
3
Last reply by dpelto 4yrs ago
Diab's avatar

Separate migration files for testing

Hi guys, I have a project with tons of migration files on hand (lots of modifications to the original table schemas kind of projects) that needs unit-testing coverage. So, after configuring the phpunit.xml file to use SQLite and running the test as expected SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL (SQL: alter table "users"

Diab's avatar
Diab's avatar Diab4yrs agoTesting
2
1
Last reply by Diab 4yrs ago
grgbikash05's avatar

Test running slow

Hello guys, I had written some tests but it is running slow because we are using real database for testing. I cannot use sqlite for testing because there are some of the old migrations where certain actions like renaming column, dropping unique keys isnot supported. Any tips to make the tests run faster?

grgbikash05's avatar
grgbikash05's avatar Tray24yrs agoTesting
1
1
Last reply by Tray2 4yrs ago
Foks's avatar

GitHub Actions fails with weird message.

I recently attempted to add PHPStan to my GitHub actions, and it failed horribly - when I then reverted my GitHub actions kept failing, and it seems like it doesn't run my PHPUnit tests. The error that it outputs is the following: Run php artisan test --parallel Warning: TTY mode requires /dev/tty to be read/writable. ..F. In WorkerCrashedException.php line 36:

Foks's avatar
Foks's avatar Foks4yrs agoTesting
2
1
Last reply by Foks 4yrs ago
number6's avatar

During Testing Only: SQLSTATE[42S22]: Column not found: 1054 Unknown column

I have a migration where I add a column to a table like so: public function up() { Schema::table('applications', function (Blueprint $table) { $table->string('state')->after('template_id')->default(''); // in progress, in review, etc. $table->index(['team_id'], 'app_team_idx'); }); } public function down() { Schema::table('application

number6's avatar
number6's avatar number64yrs agoTesting
3
1
Last reply by number6 4yrs ago
afoysal's avatar

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known

I am working in a Laravel project. My .env file is like below APP_NAME= APP_KEY=base64:8A6EtfcKlr98ocYl69PC27UmTzNtcfoldJaZMXxWeHM APP_DEBUG=true LOG_CHANNEL=daily BROADCAST_DRIVER=redis CACHE_DRIVER=file QUEUE_CONNECTION=database SESSION_LIFETIME=1200000 REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= PUSHER_APP

afoysal's avatar
afoysal's avatar Tray24yrs agoLaravel
1
1
Last reply by Tray2 4yrs ago
chrisbarm's avatar

Return rowid on create record in SQLite3

Hi, When I create a new record in SQLite I need to return the rowid for the new record. How can I do this? Many thanks in advance

chrisbarm's avatar
chrisbarm's avatar chrisbarm4yrs agoEloquent
4
1
Last reply by chrisbarm 4yrs ago
Romain's avatar

Tests Failing on GitHub Actions

Hey there. Tests passing locally, but failing on Github Actions. I've looked everywhere, don't know why. Thing is, the failing on Github kind of make sense and therefore the passing locally is a bit strange. So I'm running my test using SQLite, with a proper database, not the memory one. phpunit.xml <?xml version="1.0" encoding="UTF-8"?> <phpunit xm

Romain's avatar
Romain's avatar tamaraR964yrs agoLaravel
1
41
Last reply by tamaraR96 4yrs ago
Konstruktionsplan's avatar

Larave + GitHub Actions

Hallo! Maybe someone has used Actions with the default YML for Laravel at GitHub and can help me. :) Run composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist shell: /usr/bin/bash -e {0} Error: Process completed with exit code 1. Yml: name: Laravel on:

Konstruktionsplan's avatar
Konstruktionsplan's avatar martinbean4yrs agoLaravel
1
1
Last reply by martinbean 4yrs ago
rafaelogic's avatar

Multi-tenancy testing at snail's pace

I am using spatie laravel multi-tenancy package with livewire. I only have 56 tests and when I run phpunit it took at least 20 mins. to finish and at least 16 mins. when running with paratest. This only happens after I implemented multi-tenancy as all tests finish less than a minute without it. This is my TestCase.php code base. <?php namespace Tests; use App\Models\Tenant

rafaelogic's avatar
rafaelogic's avatar tylernatha...4yrs agoTesting
1
2
Last reply by tylernathanreed 4yrs ago
ssquare's avatar

SQLSTATE[HY000]: General error: 1 ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint error on test environment

I am using mysql on my laravel enviroment and I am using sqlite as database on .env.testing. I could easily run php artisan migrate:fresh --seed on laravel but if I run php artisan migrate:fresh --seed --env=testing I am getting error: SQLSTATE[HY000]: General error: 1 ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint And my this particular seeder where i

ssquare's avatar
ssquare's avatar circleback3yrs agoTesting
3
4
Last reply by circleback 3yrs ago
mdemori's avatar

preserve database data between subsequent tests

Hi, I've a test class with two distinct tests where I need to maintain data between two test inside the db. Everything is configured as sqlite in memory db. The problem is that after executing the test_create_quotation_from_external_system (see below the example) the db seem reset to an empty state, so the test_create_quotation_if_quotation_alredy_exists don't find any data ins

mdemori's avatar
mdemori's avatar SilenceBri...4yrs agoTesting
1
1
Last reply by SilenceBringer 4yrs ago
Kieran_st's avatar

PHPUnit/Cypress Testing 2 Databases

Hi all, so I'm trying to set up testing for my project part-way through (cause I was silly and didn't write tests from the start... I'll give a quick summary of the project so there is some context... A community runs a game server, which uses a database for in-game persistence, logs, and other data. I'm writing a utility site so that users can view their in-game character inf

Kieran_st's avatar
Kieran_st's avatar Kieran_st4yrs agoTesting
1
1
Last reply by Kieran_st 4yrs ago
laracastsluvr's avatar

Possible to change DB Driver on specific test class?

Hello, my question is same as the title. Is it possible to use a different database driver for one specific test class? I'm currently using in_memory sqlite for testing, but I have a specific feature I need to test which makes use of MySQL user declared variables using the := assignment operator. The := assignment operator (or maybe user variables) isn't supported by SQLite fro

laracastsluvr's avatar
laracastsluvr's avatar laracastsl...4yrs agoTesting
4
1
Last reply by laracastsluvr 4yrs ago
GodziLaravel's avatar

SQLITE3: migration runs without issues but Post request returns "could not find driver (SQL: insert into..."

Hello , I installed Lumen and when I run the migration it works (which is good) but when I try to post it returns me this error message : could not find driver (SQL: insert into "measurements" ("duration", "id", "updated_at", "created_at") values (33, 7a8063e4-4165-49b4-8bc7-1b759aeec57c, 2021-05-23 20:45:36, 2021-05-23 20:45:3

GodziLaravel's avatar
GodziLaravel's avatar GodziLarav...5yrs agoGeneral
0
1

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.