Task 8 - rename table

This commit is contained in:
PovilasKorop
2021-11-09 10:58:48 +02:00
parent 76504ffe87
commit 57f6333ea3
4 changed files with 77 additions and 0 deletions
+9
View File
@@ -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']);
}
}