T2: Database Schema + All Migrations - 10 migrations: users extension, services, songs, song_groups, song_slides, song_arrangements, song_arrangement_groups, service_songs, slides, cts_sync_log - 9 Eloquent models with relationships and casts - 9 factory classes for testing - Tests: DatabaseSchemaTest (2 tests, 26 assertions) ✅ T3: ChurchTools OAuth Provider - Custom Socialite provider for ChurchTools OAuth2 - AuthController with redirect/callback/logout - Replaced Breeze login with OAuth-only (German UI) - Removed all Breeze register/password-reset pages - Tests: OAuthTest (9 tests, 54 assertions) ✅ T4: CTS API Service + Sync Command - ChurchToolsService wrapping 5pm-HDH/churchtools-api - SyncChurchToolsCommand (php artisan cts:sync) - SyncController for refresh button - CCLI-based song matching - Tests: ChurchToolsSyncTest (2 tests) ✅ T5: File Conversion Service - FileConversionService with letterbox/pillarbox to 1920×1080 - ConvertPowerPointJob (queued) with LibreOffice + spatie/pdf-to-image - ZIP extraction and recursive processing - Thumbnail generation (320×180) - Tests: FileConversionTest (2 tests, 21 assertions) ✅ T6: Shared Vue Components - AuthenticatedLayout with nav, user info, refresh button - useAutoSave composable (500ms debounce) - FlashMessage, ConfirmDialog, LoadingSpinner components - HandleInertiaRequests middleware with shared props - Tests: SharedPropsTest (7 tests) ✅ T7: Email Configuration - MissingSongRequest mailable (German) - Email template with song info and service link - SONG_REQUEST_EMAIL config - Tests: MissingSongMailTest (2 tests, 10 assertions) ✅ All tests passing: 30/30 (233 assertions) All UI text in German with 'Du' form Wave 1 complete: 7/7 tasks ✅
73 lines
2.4 KiB
PHP
73 lines
2.4 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Mail\MissingSongRequest;
|
|
use Illuminate\Support\Facades\Mail;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Tests\TestCase;
|
|
|
|
class MissingSongMailTest extends TestCase
|
|
{
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
// Register a test route for services.edit
|
|
Route::get('/services/{id}/edit', function ($id) {
|
|
return "Service {$id}";
|
|
})->name('services.edit');
|
|
}
|
|
|
|
public function test_missing_song_request_mailable_renders_with_german_content(): void
|
|
{
|
|
$songName = 'Großer Gott';
|
|
$ccliId = '12345678';
|
|
$serviceId = 1;
|
|
$serviceTitle = 'Sonntagsgottesdienst';
|
|
$serviceDate = '2026-03-08';
|
|
|
|
// Create a mock service object
|
|
$service = new \stdClass();
|
|
$service->id = $serviceId;
|
|
$service->title = $serviceTitle;
|
|
$service->date = $serviceDate;
|
|
|
|
$mailable = new MissingSongRequest($songName, $ccliId, $service);
|
|
|
|
// Assert the mailable renders without errors
|
|
$rendered = $mailable->render();
|
|
$subject = $mailable->build()->subject;
|
|
$rendered = $mailable->render();
|
|
|
|
// Check that the rendered content contains German text
|
|
$this->assertStringContainsString('Song-Anfrage', $subject);
|
|
$this->assertStringContainsString($songName, $rendered);
|
|
$this->assertStringContainsString($ccliId, $rendered);
|
|
$this->assertStringContainsString($serviceTitle, $rendered);
|
|
$this->assertStringContainsString('wird folgender Song benötigt', $rendered);
|
|
$this->assertStringContainsString('Bitte erstelle diesen Song', $rendered);
|
|
$this->assertStringContainsString('/services/1/edit', $rendered);
|
|
}
|
|
|
|
public function test_missing_song_request_mailable_has_correct_subject(): void
|
|
{
|
|
$songName = 'Großer Gott';
|
|
$ccliId = '12345678';
|
|
|
|
$service = new \stdClass();
|
|
$service->id = 1;
|
|
$service->title = 'Sonntagsgottesdienst';
|
|
$service->date = '2026-03-08';
|
|
|
|
$mailable = new MissingSongRequest($songName, $ccliId, $service);
|
|
|
|
// Get the subject from the mailable
|
|
$subject = $mailable->build()->subject;
|
|
|
|
$this->assertStringContainsString('Song-Anfrage', $subject);
|
|
$this->assertStringContainsString($songName, $subject);
|
|
$this->assertStringContainsString($ccliId, $subject);
|
|
}
|
|
}
|