2017-08-31 11:14:21 -07:00
|
|
|
<?php
|
2017-09-18 12:29:08 -07:00
|
|
|
use App\Exceptions\CheckoutNotAllowed;
|
2017-08-31 11:14:21 -07:00
|
|
|
use App\Models\Asset;
|
|
|
|
use App\Models\AssetModel;
|
|
|
|
use App\Models\Category;
|
|
|
|
use App\Models\Location;
|
|
|
|
use App\Models\User;
|
|
|
|
use App\Notifications\CheckoutNotification;
|
|
|
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
|
|
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
|
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
use Illuminate\Support\Facades\Notification;
|
|
|
|
|
|
|
|
class NotificationTest extends BaseTest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var \UnitTester
|
|
|
|
*/
|
|
|
|
protected $tester;
|
|
|
|
|
2018-02-22 21:46:58 -08:00
|
|
|
// public function testAUserIsEmailedIfTheyCheckoutAnAssetWithEULA()
|
|
|
|
// {
|
|
|
|
// $admin = factory(User::class)->states('superuser')->create();
|
|
|
|
// Auth::login($admin);
|
|
|
|
// $cat = factory(Category::class)->states('asset-category', 'requires-acceptance')->create();
|
|
|
|
// $model = factory(AssetModel::class)->create(['category_id' => $cat->id]);
|
|
|
|
// $asset = factory(Asset::class)->create(['model_id' => $model->id]);
|
2017-08-31 11:14:21 -07:00
|
|
|
|
2018-02-22 21:46:58 -08:00
|
|
|
// $user = factory(User::class)->create();
|
|
|
|
// Notification::fake();
|
|
|
|
// $asset->checkOut($user, 1);
|
2017-08-31 11:14:21 -07:00
|
|
|
|
2018-02-22 21:46:58 -08:00
|
|
|
// Notification::assertSentTo($user, CheckoutNotification::class);
|
|
|
|
// }
|
2017-08-31 11:14:21 -07:00
|
|
|
|
2018-02-22 21:46:58 -08:00
|
|
|
// public function testAnAssetRequiringAEulaDoesNotExplodeWhenCheckedOutToALocation()
|
|
|
|
// {
|
|
|
|
// $this->signIn();
|
|
|
|
// $asset = factory(Asset::class)->states('requires-acceptance')->create();
|
2017-08-31 11:14:21 -07:00
|
|
|
|
2018-02-22 21:46:58 -08:00
|
|
|
// $this->expectException(CheckoutNotAllowed::class);
|
|
|
|
// $location = factory(Location::class)->create();
|
|
|
|
// Notification::fake();
|
|
|
|
// $asset->checkOut($location, 1);
|
2017-08-31 11:14:21 -07:00
|
|
|
|
2018-02-22 21:46:58 -08:00
|
|
|
// Notification::assertNotSentTo($location, CheckoutNotification::class);
|
|
|
|
// }
|
2017-08-31 11:14:21 -07:00
|
|
|
}
|