mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Scaffold accessory checkout tests for api
This commit is contained in:
parent
987676df08
commit
e5d3df7d24
64
tests/Feature/Api/Accessories/AccessoryCheckoutTest.php
Normal file
64
tests/Feature/Api/Accessories/AccessoryCheckoutTest.php
Normal file
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Api\Accessories;
|
||||
|
||||
use App\Models\Accessory;
|
||||
use App\Models\User;
|
||||
use App\Notifications\CheckoutAccessoryNotification;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Tests\Support\InteractsWithSettings;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AccessoryCheckoutTest extends TestCase
|
||||
{
|
||||
use InteractsWithSettings;
|
||||
|
||||
public function testCheckingOutAccessoryRequiresCorrectPermission()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
public function testValidation()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
public function testAccessoryMustBeAvailableWhenCheckingOut()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
public function testAccessoryCanBeCheckedOut()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
public function testUserSentNotificationUponCheckout()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
|
||||
$this->withoutExceptionHandling();
|
||||
|
||||
Notification::fake();
|
||||
|
||||
$accessory = Accessory::factory()->requiringAcceptance()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->actingAsForApi(User::factory()->checkoutAccessories()->create())
|
||||
->postJson(route('api.accessories.checkout', $accessory), [
|
||||
'assigned_to' => $user->id,
|
||||
]);
|
||||
|
||||
Notification::assertSentTo($user, CheckoutAccessoryNotification::class);
|
||||
}
|
||||
|
||||
public function testActionLogCreatedUponCheckout()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
public function testUserSentEulaUponCheckoutIfAcceptanceRequired()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
}
|
|
@ -3,7 +3,6 @@
|
|||
namespace Tests\Feature\Checkouts;
|
||||
|
||||
use App\Models\Accessory;
|
||||
use App\Models\Actionlog;
|
||||
use App\Models\User;
|
||||
use App\Notifications\CheckoutAccessoryNotification;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
|
|
Loading…
Reference in a new issue