mirror of
https://github.com/10h30/Test-Laravel-Eloquent-Basics.git
synced 2026-06-05 15:07:45 +09:00
Improved first test
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\Morningnews;
|
||||
use App\Models\News;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
@@ -10,13 +11,13 @@ class EloquentTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_create_model_different_table()
|
||||
// TASK: Make the model Morningnews work with DB table "morning_news"
|
||||
public function test_create_model_incorrect_table()
|
||||
{
|
||||
$article = ['title' => 'Something', 'news_text' => 'Something'];
|
||||
News::create($article);
|
||||
Morningnews::create($article);
|
||||
|
||||
$this->assertDatabaseHas('morning_news', $article);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user