mirror of
https://github.com/10h30/Test-Laravel-Migrations.git
synced 2026-06-05 15:07:54 +09:00
Task 8 - rename table
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Models\Project;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Tests\TestCase;
|
||||
|
||||
class MigrationsTest extends TestCase
|
||||
@@ -95,4 +96,12 @@ class MigrationsTest extends TestCase
|
||||
$company = Company::first();
|
||||
$this->assertEquals('My company', $company->name);
|
||||
}
|
||||
|
||||
public function test_renamed_table()
|
||||
{
|
||||
Artisan::call('migrate:fresh', ['--path' => '/database/migrations/task8']);
|
||||
|
||||
DB::table('companies')->insert(['name' => 'First']);
|
||||
$this->assertDatabaseHas(Company::class, ['name' => 'First']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user