22 lines
661 B
PHP
22 lines
661 B
PHP
<?php
|
|
|
|
use App\Models\MediaMonitoring;
|
|
use App\Models\MediaMonitoringTheme;
|
|
use App\Models\Theme;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
test('media monitoring theme relation works', function () {
|
|
$monitoring = MediaMonitoring::factory()->create();
|
|
$theme = Theme::factory()->create();
|
|
$mmt = MediaMonitoringTheme::factory()->create([
|
|
'media_monitoring_id' => $monitoring->id,
|
|
'theme_id' => $theme->id,
|
|
]);
|
|
|
|
expect($mmt->mediaMonitoring->id)->toBe($monitoring->id);
|
|
expect($mmt->theme->id)->toBe($theme->id);
|
|
expect($monitoring->themes->first()->id)->toBe($theme->id);
|
|
});
|