Files
Test-Laravel-Eloquent-Basics/tests/Feature/EloquentTest.php
T
PovilasKorop 8c860fbac5 First test
2021-11-15 08:25:07 +02:00

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);
}
}