41 lines
1.4 KiB
PHP
41 lines
1.4 KiB
PHP
<?php
|
||
require __DIR__ . '/../vendor/autoload.php';
|
||
$app = require_once __DIR__ . '/../bootstrap/app.php';
|
||
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
|
||
|
||
$testCodes = [
|
||
'TRN-2026-0QQJ-DAC6', // Emre Satıl
|
||
'TRN-2026-KB58-U0RO', // Ayşenur Ebrar Gündüz
|
||
'TRN-2026-YJST-MLYF', // Eren Kara
|
||
'TRN-2026-2EM8-AL2H', // Faruk Tazeoğlu
|
||
];
|
||
|
||
echo "Testing HTTP Verification Pages & Print Journal:\n";
|
||
|
||
foreach ($testCodes as $code) {
|
||
$request = Illuminate\Http\Request::create('/staj-dogrulama/' . $code, 'GET');
|
||
$response = $kernel->handle($request);
|
||
$status = $response->getStatusCode();
|
||
$content = $response->getContent();
|
||
$hasCert = str_contains($content, 'STAJ BİTİRME');
|
||
$hasTranscript = str_contains($content, 'STAJ AKADEMİK TRANSKRİPTİ');
|
||
|
||
echo sprintf("Code: %s -> HTTP Status: %d | HasCert: %s | HasTrans: %s\n",
|
||
$code,
|
||
$status,
|
||
$hasCert ? 'YES' : 'NO',
|
||
$hasTranscript ? 'YES' : 'NO'
|
||
);
|
||
$kernel->terminate($request, $response);
|
||
}
|
||
|
||
// Test Print Journal
|
||
$printReq = Illuminate\Http\Request::create('/stajyer/defteri-yazdir?size=a4&intern_id=18', 'GET');
|
||
// simulate super_admin auth
|
||
$superAdmin = \App\Models\User::first();
|
||
if ($superAdmin) {
|
||
auth()->login($superAdmin);
|
||
}
|
||
$printResp = $kernel->handle($printReq);
|
||
echo "Print Journal A4 (Intern #18) -> HTTP Status: " . $printResp->getStatusCode() . " | Length: " . strlen($printResp->getContent()) . "\n";
|