Complete tests

This commit is contained in:
Bubka
2024-03-30 15:42:54 +01:00
parent eb3e38f4a6
commit f43fc97523
5 changed files with 218 additions and 0 deletions

View File

@ -6,6 +6,7 @@ use App\Http\Controllers\SystemController;
use App\Models\User;
use App\Notifications\TestEmailSettingNotification;
use App\Services\ReleaseRadarService;
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Facades\Notification;
use PHPUnit\Framework\Attributes\CoversClass;
use Tests\FeatureTestCase;
@ -14,6 +15,8 @@ use Tests\FeatureTestCase;
* SystemControllerTest test class
*/
#[CoversClass(SystemController::class)]
#[CoversClass(TestEmailSettingNotification::class)]
class SystemControllerTest extends FeatureTestCase
{
/**
@ -133,6 +136,19 @@ class SystemControllerTest extends FeatureTestCase
Notification::assertSentTo($this->admin, TestEmailSettingNotification::class);
}
/**
* @test
*/
public function test_testEmail_renders_to_email()
{
$mail = (new TestEmailSettingNotification('test_token'))->toMail($this->user)->render();
$this->assertStringContainsString(
Lang::get('notifications.test_email_settings.reason'),
$mail
);
}
/**
* @test
*/