Apply fixes from StyleCI

This commit is contained in:
StyleCI Bot
2023-09-18 05:23:17 +00:00
parent 04e7674fa1
commit 96a01671ff

View File

@@ -6,12 +6,13 @@ use App\Model\helpdesk\Ticket\Ticket_Thread;
use App\Model\helpdesk\Ticket\Tickets;
use App\User;
use DateTimeZone;
use Faker\Factory as FakerFactory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Str;
use Tests\TestCase;
use UTC;
use Faker\Factory as FakerFactory;
class TicketControllerTest extends TestCase
{
/**
@@ -26,7 +27,7 @@ class TicketControllerTest extends TestCase
//Create User -> Agent
//$str = Str::random(10);
$str ="demopass";
$str = 'demopass';
$password = Hash::make($str);
$email = $faker->unique()->email();
$user = new User([
@@ -63,7 +64,6 @@ class TicketControllerTest extends TestCase
// Assert that the response status code is 200 (OK)
$dashboardResponse->assertStatus(200);
// Create a ticket for testing.
$ticket = new Tickets(
@@ -82,7 +82,6 @@ class TicketControllerTest extends TestCase
$ticket->dept_id = 1;
$ticket->save();
//Create Ticket_thread for Testing
$ticket_thread = new Ticket_Thread(
@@ -97,7 +96,6 @@ class TicketControllerTest extends TestCase
$ticket_thread->save();
// Make a GET request to the getTooltip
$response = $this->get(route('ticket.tooltip', ['ticket_id' => $ticket->id]));
@@ -126,8 +124,6 @@ class TicketControllerTest extends TestCase
// Assert that the response content contains the expected tooltip content
$result->assertSee($expectedTooltip, $escaped = false);
}
//Testing Reply Alert and Last Activity filed
@@ -151,13 +147,11 @@ class TicketControllerTest extends TestCase
$url = route('ticket.thread', ['id' => $tickets->id]);
$response2 = $this->get($url);
// Assert that the response status is 200 (OK).
$response2->assertStatus(200);
// Create fake data for the reply
$replyData = [
@@ -181,14 +175,13 @@ class TicketControllerTest extends TestCase
$result_date = $response4->getDate();
$userTimeZone = new DateTimeZone("Asia/Kolkata");
$userTimeZone = new DateTimeZone('Asia/Kolkata');
// Convert the DateTime object to the user's time zone
$result_date = $result_date->setTimezone($userTimeZone);
$result_date = $result_date->format("d/m/Y H:i:s");
$result_date = $result_date->format('d/m/Y H:i:s');
//Converting Updated_at to User Timezone
@@ -201,7 +194,5 @@ class TicketControllerTest extends TestCase
// Asserting if the last_activity is updated correctly
$this->assertEquals($expected_date, $result_date);
}
}