update tests

This commit is contained in:
root
2026-06-08 22:06:30 -04:00
parent 79024235ef
commit 60ecacb7f8
54 changed files with 13243 additions and 5561 deletions
@@ -0,0 +1,42 @@
<?php
namespace Tests\Feature\Api\V1;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\Concerns\CreatesApiTestUsers;
use Tests\TestCase;
class ScannerControllerTest extends TestCase
{
use CreatesApiTestUsers;
use RefreshDatabase;
protected function setUp(): void
{
parent::setUp();
$this->seedApiTestConfig();
}
public function test_process_requires_a_badge_code(): void
{
$this->postJson('/api/v1/scanner/process', ['badgeCode' => ''])
->assertStatus(400)
->assertJsonPath('status', false)
->assertJsonPath('ok', false);
}
public function test_process_returns_404_for_unknown_badge(): void
{
$this->postJson('/api/v1/scanner/process', ['badgeCode' => 'NO-SUCH-BADGE'])
->assertNotFound()
->assertJsonPath('status', false)
->assertJsonPath('ok', false);
}
public function test_process_accepts_alternative_badge_field_names(): void
{
$this->postJson('/api/v1/scanner/process', ['barcode' => 'STILL-UNKNOWN'])
->assertNotFound()
->assertJsonPath('status', false);
}
}