mirror of
https://github.com/snipe/snipe-it.git
synced 2026-03-02 14:29:30 +00:00
25 lines
641 B
PHP
25 lines
641 B
PHP
<?php
|
|
|
|
namespace Tests\Feature\Checkins\General;
|
|
|
|
use App\Models\Accessory;
|
|
use App\Models\User;
|
|
use Tests\TestCase;
|
|
|
|
class CheckinTest extends TestCase
|
|
{
|
|
public function test_gracefully_handles_category_being_soft_deleted()
|
|
{
|
|
$this->withoutExceptionHandling();
|
|
|
|
$accessory = Accessory::factory()->checkedOutToUser()->create();
|
|
|
|
$accessory->category->delete();
|
|
|
|
$this->actingAs(User::factory()->checkinAccessories()->create())
|
|
->post(route('accessories.checkin.store', $accessory->checkouts->first()->id));
|
|
|
|
$this->assertEquals(0, $accessory->fresh()->checkouts->count());
|
|
}
|
|
}
|