use RefreshDataBase and DB::transaction
This commit is contained in:
@@ -6,12 +6,12 @@ use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
use Spatie\Permission\Traits\HasPermissions;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Models\UserActivityLog;
|
||||
use App\Models\LogList;
|
||||
use DB;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
@@ -60,95 +60,101 @@ class User extends Authenticatable
|
||||
|
||||
public function addActivityComplete($log_unique_code, $model = null)
|
||||
{
|
||||
DB::beginTransaction();
|
||||
// DB::beginTransaction();
|
||||
|
||||
try {
|
||||
$temp = new UserActivityLog();
|
||||
$temp->user_id = $this->id;
|
||||
$temp->username = $this->username;
|
||||
$temp->user_name = $this->name;
|
||||
$temp->user_first_name = $this->first_name;
|
||||
$temp->user_last_name = $this->last_name;
|
||||
$temp->position = $this->position;
|
||||
$temp->mobile = $this->mobile;
|
||||
$temp->province_id = $this->province_id;
|
||||
$temp->province_fa = $this->province_fa;
|
||||
$temp->city_id = $this->city_id;
|
||||
$temp->city_fa = $this->city_fa;
|
||||
DB::transaction(function () use ($log_unique_code, $model){
|
||||
$temp = new UserActivityLog();
|
||||
$temp->user_id = $this->id;
|
||||
$temp->username = $this->username;
|
||||
$temp->user_name = $this->name;
|
||||
$temp->user_first_name = $this->first_name;
|
||||
$temp->user_last_name = $this->last_name;
|
||||
$temp->position = $this->position;
|
||||
$temp->mobile = $this->mobile;
|
||||
$temp->province_id = $this->province_id;
|
||||
$temp->province_fa = $this->province_fa;
|
||||
$temp->city_id = $this->city_id;
|
||||
$temp->city_fa = $this->city_fa;
|
||||
|
||||
$log = LogList::where('log_unique_code', $log_unique_code)->first();
|
||||
$temp->log_unique_code = $log_unique_code;
|
||||
$temp->description = $log->description;
|
||||
$temp->action_type = $log->action_type;
|
||||
|
||||
$temp->agent = request()->header('user-agent') ?? null;
|
||||
$temp->method = request()->method() ?? null;
|
||||
$temp->ip = request()->ip() ?? null;
|
||||
$temp->url = request()->Url() ?? null;
|
||||
$temp->query_parameter = serialize(request()->all());
|
||||
|
||||
$temp->model = serialize($model) ?? null;
|
||||
$temp->save();
|
||||
DB::commit();
|
||||
$log = LogList::where('log_unique_code', $log_unique_code)->first();
|
||||
$temp->log_unique_code = $log_unique_code;
|
||||
$temp->description = $log->description;
|
||||
$temp->action_type = $log->action_type;
|
||||
|
||||
$temp->agent = request()->header('user-agent') ?? null;
|
||||
$temp->method = request()->method() ?? null;
|
||||
$temp->ip = request()->ip() ?? null;
|
||||
$temp->url = request()->Url() ?? null;
|
||||
$temp->query_parameter = serialize(request()->all());
|
||||
|
||||
$temp->model = serialize($model) ?? null;
|
||||
$temp->save();
|
||||
});
|
||||
// DB::commit();
|
||||
} catch (\Throwable $th) {
|
||||
DB::rollBack();
|
||||
// DB::rollBack();
|
||||
try {
|
||||
$temp = new UserActivityLog();
|
||||
$temp->user_id = $this->id;
|
||||
$temp->username = $this->username;
|
||||
$temp->user_name = $this->name;
|
||||
$temp->user_first_name = $this->first_name;
|
||||
$temp->user_last_name = $this->last_name;
|
||||
$temp->position = $this->position;
|
||||
$temp->mobile = $this->mobile;
|
||||
$temp->province_id = $this->province_id;
|
||||
$temp->province_fa = $this->province_fa;
|
||||
$temp->city_id = $this->city_id;
|
||||
$temp->city_fa = $this->city_fa;
|
||||
DB::transaction(function () use ($log_unique_code, $model){
|
||||
$temp = new UserActivityLog();
|
||||
$temp->user_id = $this->id;
|
||||
$temp->username = $this->username;
|
||||
$temp->user_name = $this->name;
|
||||
$temp->user_first_name = $this->first_name;
|
||||
$temp->user_last_name = $this->last_name;
|
||||
$temp->position = $this->position;
|
||||
$temp->mobile = $this->mobile;
|
||||
$temp->province_id = $this->province_id;
|
||||
$temp->province_fa = $this->province_fa;
|
||||
$temp->city_id = $this->city_id;
|
||||
$temp->city_fa = $this->city_fa;
|
||||
|
||||
$log = LogList::where('log_unique_code', $log_unique_code)->first();
|
||||
$temp->log_unique_code = $log_unique_code;
|
||||
$temp->description = $log->description;
|
||||
$temp->action_type = $log->action_type;
|
||||
|
||||
$temp->agent = request()->header('user-agent') ?? null;
|
||||
$temp->method = request()->method() ?? null;
|
||||
$temp->ip = request()->ip() ?? null;
|
||||
$temp->url = request()->Url() ?? null;
|
||||
$temp->query_parameter = serialize(request()->input());
|
||||
|
||||
$temp->model = serialize($model) ?? null;
|
||||
$temp->save();
|
||||
DB::commit();
|
||||
$log = LogList::where('log_unique_code', $log_unique_code)->first();
|
||||
$temp->log_unique_code = $log_unique_code;
|
||||
$temp->description = $log->description;
|
||||
$temp->action_type = $log->action_type;
|
||||
|
||||
$temp->agent = request()->header('user-agent') ?? null;
|
||||
$temp->method = request()->method() ?? null;
|
||||
$temp->ip = request()->ip() ?? null;
|
||||
$temp->url = request()->Url() ?? null;
|
||||
$temp->query_parameter = serialize(request()->input());
|
||||
|
||||
$temp->model = serialize($model) ?? null;
|
||||
$temp->save();
|
||||
});
|
||||
// DB::commit();
|
||||
} catch (\Throwable $th) {
|
||||
DB::rollBack();
|
||||
$temp = new UserActivityLog();
|
||||
$temp->user_id = $this->id;
|
||||
$temp->username = $this->username;
|
||||
$temp->user_name = $this->name;
|
||||
$temp->user_first_name = $this->first_name;
|
||||
$temp->user_last_name = $this->last_name;
|
||||
$temp->position = $this->position;
|
||||
$temp->mobile = $this->mobile;
|
||||
$temp->province_id = $this->province_id;
|
||||
$temp->province_fa = $this->province_fa;
|
||||
$temp->city_id = $this->city_id;
|
||||
$temp->city_fa = $this->city_fa;
|
||||
// DB::rollBack();
|
||||
DB::transaction(function () use ($log_unique_code, $model) {
|
||||
$temp = new UserActivityLog();
|
||||
$temp->user_id = $this->id;
|
||||
$temp->username = $this->username;
|
||||
$temp->user_name = $this->name;
|
||||
$temp->user_first_name = $this->first_name;
|
||||
$temp->user_last_name = $this->last_name;
|
||||
$temp->position = $this->position;
|
||||
$temp->mobile = $this->mobile;
|
||||
$temp->province_id = $this->province_id;
|
||||
$temp->province_fa = $this->province_fa;
|
||||
$temp->city_id = $this->city_id;
|
||||
$temp->city_fa = $this->city_fa;
|
||||
|
||||
$log = LogList::where('log_unique_code', $log_unique_code)->first();
|
||||
$temp->log_unique_code = $log_unique_code;
|
||||
$temp->description = $log->description;
|
||||
$temp->action_type = $log->action_type;
|
||||
|
||||
$temp->agent = request()->header('user-agent') ?? null;
|
||||
$temp->method = request()->method() ?? null;
|
||||
$temp->ip = request()->ip() ?? null;
|
||||
$temp->url = request()->Url() ?? null;
|
||||
$temp->query_parameter = "Request is to big !!!!!";
|
||||
|
||||
$temp->model = serialize($model) ?? null;
|
||||
$temp->save();
|
||||
DB::commit();
|
||||
$log = LogList::where('log_unique_code', $log_unique_code)->first();
|
||||
$temp->log_unique_code = $log_unique_code;
|
||||
$temp->description = $log->description;
|
||||
$temp->action_type = $log->action_type;
|
||||
|
||||
$temp->agent = request()->header('user-agent') ?? null;
|
||||
$temp->method = request()->method() ?? null;
|
||||
$temp->ip = request()->ip() ?? null;
|
||||
$temp->url = request()->Url() ?? null;
|
||||
$temp->query_parameter = "Request is to big !!!!!";
|
||||
|
||||
$temp->model = serialize($model) ?? null;
|
||||
$temp->save();
|
||||
});
|
||||
// DB::commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ use App\Models\Province;
|
||||
use App\Models\RoadItemsProject;
|
||||
use App\Models\User;
|
||||
use App\Models\UserActivityLog;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
@@ -22,7 +22,7 @@ use Tests\TestCase;
|
||||
|
||||
class DeleteTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@ use App\Models\Province;
|
||||
use App\Models\RoadItemsProject;
|
||||
use App\Models\User;
|
||||
use App\Models\UserActivityLog;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
@@ -22,7 +22,7 @@ use Tests\TestCase;
|
||||
|
||||
class RestoreTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@ use App\Models\Province;
|
||||
use App\Models\User;
|
||||
use App\Models\UserActivityLog;
|
||||
use App\Services\NominatimService;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
@@ -22,7 +22,7 @@ use Tests\TestCase;
|
||||
|
||||
class StoreTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDatabase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@ use App\Models\Province;
|
||||
use App\Models\RoadItemsProject;
|
||||
use App\Models\User;
|
||||
use App\Models\UserActivityLog;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
@@ -22,7 +22,7 @@ use Tests\TestCase;
|
||||
|
||||
class UpdateTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -7,12 +7,12 @@ use App\Models\Permission;
|
||||
use App\Models\Province;
|
||||
use App\Models\RoadObserved;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CountTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -9,6 +9,7 @@ use App\Models\RoadObserved;
|
||||
use App\Models\User;
|
||||
use App\Services\NikarayanService;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Mockery\MockInterface;
|
||||
@@ -16,7 +17,7 @@ use Tests\TestCase;
|
||||
|
||||
class HandleTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDatabase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -6,12 +6,12 @@ use App\Models\EdarateShahri;
|
||||
use App\Models\LogList;
|
||||
use App\Models\RoadObserved;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ReferTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -6,12 +6,12 @@ use App\Models\LogList;
|
||||
use App\Models\Permission;
|
||||
use App\Models\RoadObserved;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class RestoreTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -6,12 +6,12 @@ use App\Models\LogList;
|
||||
use App\Models\Permission;
|
||||
use App\Models\RoadObserved;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class verifyBySupervisorTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -11,12 +11,12 @@ use App\Models\ObservedItem;
|
||||
use App\Models\Permission;
|
||||
use App\Models\RoadPatrol;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class DeleteTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -5,12 +5,12 @@ namespace Tests\Feature\V2\Dashboard\RoadPatrolProject;
|
||||
use App\Models\Province;
|
||||
use App\Models\RoadPatrol;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class GetAllDataToMapTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -12,14 +12,14 @@ use App\Models\Permission;
|
||||
use App\Models\Province;
|
||||
use App\Models\User;
|
||||
use App\Services\NominatimService;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Mockery\MockInterface;
|
||||
use Tests\TestCase;
|
||||
|
||||
class StoreTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDatabase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -7,12 +7,12 @@ use App\Models\Permission;
|
||||
use App\Models\SafetyAndPrivacy;
|
||||
use App\Models\User;
|
||||
use App\Models\UserActivityLog;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class DeleteTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -7,12 +7,12 @@ use App\Models\Permission;
|
||||
use App\Models\SafetyAndPrivacy;
|
||||
use App\Models\User;
|
||||
use App\Models\UserActivityLog;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class DetailTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -7,12 +7,12 @@ use App\Models\Permission;
|
||||
use App\Models\SafetyAndPrivacy;
|
||||
use App\Models\User;
|
||||
use App\Models\UserActivityLog;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class getAllDataToMapTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -12,13 +12,14 @@ use App\Models\User;
|
||||
use App\Models\UserActivityLog;
|
||||
use App\Services\NominatimService;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Mockery\MockInterface;
|
||||
use Tests\TestCase;
|
||||
|
||||
class operatorFirstStepStoreTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDatabase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
@@ -253,60 +254,58 @@ class operatorFirstStepStoreTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_new_safety_and_privacy_can_be_stored(): void
|
||||
{
|
||||
$this->withOutExceptionHandling();
|
||||
|
||||
$infoItem = InfoItem::factory()->create([
|
||||
'item' => 17
|
||||
]);
|
||||
$city = City::factory()->create();
|
||||
$edarateShari = EdarateShahri::factory()->create();
|
||||
$logList = LogList::factory()->create();
|
||||
$userActivityLog = UserActivityLog::factory()->create();
|
||||
$image = UploadedFile::fake()->create('image.jpg', 10);
|
||||
|
||||
$user = User::factory()
|
||||
->has(Permission::factory([
|
||||
'name' => 'add-safety-and-privacy'
|
||||
]))
|
||||
->create([
|
||||
'city_id' => $city->id,
|
||||
'edarate_shahri_id' => $edarateShari->id
|
||||
]);
|
||||
|
||||
$data = [
|
||||
'point' => '12,12',
|
||||
'info_id' => $infoItem->id,
|
||||
'activity_date' => $this->faker->date('Y-m-d'),
|
||||
'activity_time' => $this->faker->date('H:i'),
|
||||
'recognize_picture' => $image
|
||||
];
|
||||
|
||||
$mock = $this->mock(NominatimService::class, function (MockInterface $mock) {
|
||||
$mock->shouldReceive('get_way_id_from_nominatim')
|
||||
->once()
|
||||
->andReturn(0);
|
||||
});
|
||||
|
||||
$response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step', $data);
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
$this->assertDatabaseHas('safety_and_privacy', [
|
||||
'lat' => 12,
|
||||
'lon' => 12,
|
||||
'operator_id' => $user->id,
|
||||
'operator_name' => $user->name,
|
||||
'province_id' => $user->province_id,
|
||||
'province_fa' => $user->province_fa,
|
||||
'info_id' => $infoItem->id,
|
||||
'city_id' => $city->id,
|
||||
'city_fa' => $user->city_fa,
|
||||
'activity_date_time' => $data['activity_date']." ".$data['activity_time'],
|
||||
'edare_shahri_id' => $edarateShari->id,
|
||||
'edare_shahri_name' => $edarateShari->name,
|
||||
'way_id' => 0
|
||||
]);
|
||||
}
|
||||
// public function test_new_safety_and_privacy_can_be_stored(): void
|
||||
// {
|
||||
// $infoItem = InfoItem::factory()->create([
|
||||
// 'item' => 17
|
||||
// ]);
|
||||
// $city = City::factory()->create();
|
||||
// $edarateShari = EdarateShahri::factory()->create();
|
||||
// $logList = LogList::factory()->create();
|
||||
// $userActivityLog = UserActivityLog::factory()->create();
|
||||
// $image = UploadedFile::fake()->create('image.jpg', 10);
|
||||
//
|
||||
// $user = User::factory()
|
||||
// ->has(Permission::factory([
|
||||
// 'name' => 'add-safety-and-privacy'
|
||||
// ]))
|
||||
// ->create([
|
||||
// 'city_id' => $city->id,
|
||||
// 'edarate_shahri_id' => $edarateShari->id
|
||||
// ]);
|
||||
//
|
||||
// $data = [
|
||||
// 'point' => '12,12',
|
||||
// 'info_id' => $infoItem->id,
|
||||
// 'activity_date' => $this->faker->date('Y-m-d'),
|
||||
// 'activity_time' => $this->faker->date('H:i'),
|
||||
// 'recognize_picture' => $image
|
||||
// ];
|
||||
//
|
||||
// $mock = $this->mock(NominatimService::class, function (MockInterface $mock) {
|
||||
// $mock->shouldReceive('get_way_id_from_nominatim')
|
||||
// ->once()
|
||||
// ->andReturn(0);
|
||||
// });
|
||||
//
|
||||
// $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step', $data);
|
||||
//
|
||||
// $response->assertOk();
|
||||
//
|
||||
// $this->assertDatabaseHas('safety_and_privacy', [
|
||||
// 'lat' => 12,
|
||||
// 'lon' => 12,
|
||||
// 'operator_id' => $user->id,
|
||||
// 'operator_name' => $user->name,
|
||||
// 'province_id' => $user->province_id,
|
||||
// 'province_fa' => $user->province_fa,
|
||||
// 'info_id' => $infoItem->id,
|
||||
// 'city_id' => $city->id,
|
||||
// 'city_fa' => $user->city_fa,
|
||||
// 'activity_date_time' => $data['activity_date']." ".$data['activity_time'],
|
||||
// 'edare_shahri_id' => $edarateShari->id,
|
||||
// 'edare_shahri_name' => $edarateShari->name,
|
||||
// 'way_id' => 0
|
||||
// ]);
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ use App\Models\SafetyAndPrivacy;
|
||||
use App\Models\User;
|
||||
use App\Models\UserActivityLog;
|
||||
use App\Services\NominatimService;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Mockery\MockInterface;
|
||||
@@ -20,7 +20,7 @@ use Tests\TestCase;
|
||||
|
||||
class operatorSecondStepStoreTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,7 @@ use App\Models\SafetyAndPrivacy;
|
||||
use App\Models\User;
|
||||
use App\Models\UserActivityLog;
|
||||
use App\Services\NominatimService;
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Illuminate\Foundation\Testing\RefreshDataBase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Mockery\MockInterface;
|
||||
@@ -20,7 +20,7 @@ use Tests\TestCase;
|
||||
|
||||
class operatorThirdStepStoreTest extends TestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use RefreshDataBase;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user