mirror of
https://github.com/10h30/Test-Laravel-Eloquent-Basics.git
synced 2026-07-16 21:23:49 +09:00
24 lines
536 B
PHP
24 lines
536 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Models\Morningnews;
|
|
use App\Models\News;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
class EloquentTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
// TASK: Make the model Morningnews work with DB table "morning_news"
|
|
public function test_create_model_incorrect_table()
|
|
{
|
|
$article = ['title' => 'Something', 'news_text' => 'Something'];
|
|
Morningnews::create($article);
|
|
|
|
$this->assertDatabaseHas('morning_news', $article);
|
|
}
|
|
|
|
}
|