40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
|
use Tests\TestCase;
|
|
|
|
/**
|
|
* REPRO SEMENTARA: memicu route update siswa keluar terhadap DB PRODUKSI.
|
|
* Tidak memakai RefreshDatabase. Data tidak diubah (nilai dikirim kosong).
|
|
* Hanya untuk menangkap exception yang bikin 500 di /students/keluar/{id} POST.
|
|
*/
|
|
class ReproExitTest extends TestCase
|
|
{
|
|
use WithoutMiddleware;
|
|
|
|
public function test_repro_update_exit_31(): void
|
|
{
|
|
// Pakai DB produksi
|
|
config(['database.default' => 'mysql']);
|
|
\Illuminate\Support\Facades\DB::purge('mysql');
|
|
|
|
$exit = \App\Models\StudentExit::find(31);
|
|
$this->assertNotNull($exit, 'exit 31 tidak ditemukan');
|
|
|
|
$res = $this->patch("/students/keluar/{$exit->id}", [
|
|
'exit_date' => '',
|
|
'exit_reason' => '',
|
|
]);
|
|
|
|
fwrite(STDERR, 'STATUS: '.$res->getStatusCode()."\n");
|
|
if (isset($res->exception)) {
|
|
fwrite(STDERR, 'EXC: '.get_class($res->exception).': '.$res->exception->getMessage()."\n");
|
|
fwrite(STDERR, 'AT: '.$res->exception->getFile().':'.$res->exception->getLine()."\n");
|
|
}
|
|
|
|
$this->assertTrue(true);
|
|
}
|
|
}
|