35 lines
876 B
PHP
35 lines
876 B
PHP
<?php
|
|
|
|
namespace Tests\Unit\Services\Families;
|
|
|
|
use App\Services\Email\EmailDispatchService;
|
|
use App\Services\Families\FamilyNotificationService;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
class FamilyNotificationServiceTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_send_compose_email_delegates_to_dispatcher(): void
|
|
{
|
|
$this->mock(EmailDispatchService::class, function ($mock) {
|
|
$mock->shouldReceive('send')
|
|
->once()
|
|
->andReturn(true);
|
|
});
|
|
|
|
$service = $this->app->make(FamilyNotificationService::class);
|
|
$result = $service->sendComposeEmail(
|
|
'recipient@example.com',
|
|
'Subject',
|
|
'<p>Body</p>',
|
|
null,
|
|
null,
|
|
null
|
|
);
|
|
|
|
$this->assertTrue($result);
|
|
}
|
|
}
|