22 lines
618 B
PHP
22 lines
618 B
PHP
<?php
|
|
|
|
use App\Models\Cooperation;
|
|
use App\Models\CooperationMedia;
|
|
use App\Models\PartnerMedia;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
test('cooperation media relation works', function () {
|
|
$cooperation = Cooperation::factory()->create();
|
|
$media = PartnerMedia::factory()->create();
|
|
|
|
$coopMedia = CooperationMedia::factory()->create([
|
|
'cooperation_id' => $cooperation->id,
|
|
'partner_media_id' => $media->id,
|
|
]);
|
|
|
|
expect($coopMedia->cooperation->id)->toBe($cooperation->id);
|
|
expect($coopMedia->partnerMedia->id)->toBe($media->id);
|
|
});
|