mirror of
https://github.com/10h30/Test-Laravel-Eloquent-Basics.git
synced 2026-07-11 19:05:53 +09:00
First test
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user