mirror of
https://github.com/10h30/Test-Laravel-Eloquent-Basics.git
synced 2026-06-05 15:07:45 +09:00
23 lines
428 B
PHP
23 lines
428 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Models\News;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
class EloquentTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_create_model_different_table()
|
|
{
|
|
$article = ['title' => 'Something', 'news_text' => 'Something'];
|
|
News::create($article);
|
|
|
|
$this->assertDatabaseHas('morning_news', $article);
|
|
}
|
|
|
|
|
|
}
|