PHP Unittest in Laravel With SQLite
In this article will showing how excute a phpunit for SQLite in laravel.
In here should prepare mysql and setting .env for database info.
First, create a hello model and use the -m options for generate a migration file
php artisan make:model Hello --m
Just need add name column in hello_table migration file:
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateHellosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('hellos', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('hellos');
}
}
Excute artisan migrate command for generate table:
Continue Reading
