feat: add routes, lang, tests, stubs, docs, and docker configurations

This commit is contained in:
2026-05-21 16:05:16 +07:00
parent fad70d096b
commit 28a06315b8
3385 changed files with 177070 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
use Illuminate\Support\Facades\Mail;
test('otp send requires email', function () {
$this->postJson('/api/v1/otp/send', [])
->assertStatus(422);
});
test('otp send accepts valid email and queues mail', function () {
Mail::fake();
$this->postJson('/api/v1/otp/send', ['email' => 'test@example.com'])
->assertOk()
->assertJsonPath('status', 'success');
});
test('otp verify rejects invalid code', function () {
$this->postJson('/api/v1/otp/verify', [
'email' => 'test@example.com',
'code' => '000000',
])->assertStatus(422)
->assertJsonPath('status', 'error');
});
test('otp verify requires 6-digit code', function () {
$this->postJson('/api/v1/otp/verify', [
'email' => 'test@example.com',
'code' => '123',
])->assertStatus(422);
});