Formatting
This commit is contained in:
@@ -1,10 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Contracts\Model;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
|
|
||||||
class UsersAddPilotId extends Migration
|
class UsersAddPilotId extends Migration
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ class UserService extends Service
|
|||||||
{
|
{
|
||||||
if (User::where('pilot_id', '=', $pilot_id)->exists()) {
|
if (User::where('pilot_id', '=', $pilot_id)->exists()) {
|
||||||
Log::error('User with id '.$pilot_id.' already exists');
|
Log::error('User with id '.$pilot_id.' already exists');
|
||||||
|
|
||||||
throw new UserPilotIdExists();
|
throw new UserPilotIdExists();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Airport;
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Repositories\SettingRepository;
|
use App\Repositories\SettingRepository;
|
||||||
use App\Services\UserService;
|
use App\Services\UserService;
|
||||||
@@ -192,6 +191,7 @@ class UserTest extends TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the pilot ID being added when a new user is created
|
* Test the pilot ID being added when a new user is created
|
||||||
|
*
|
||||||
* @expectedException \App\Exceptions\UserPilotIdExists
|
* @expectedException \App\Exceptions\UserPilotIdExists
|
||||||
*/
|
*/
|
||||||
public function testUserPilotIdChangeAlreadyExists()
|
public function testUserPilotIdChangeAlreadyExists()
|
||||||
|
|||||||
Reference in New Issue
Block a user