From 8db3038cf5fa5170709b07c832ea002d5b5299ab Mon Sep 17 00:00:00 2001 From: bidi Date: Fri, 17 Apr 2026 12:56:30 +0300 Subject: [PATCH 1/6] added login info from browscap Signed-off-by: bidi --- src/Admin/src/Service/AdminLoginService.php | 62 +++++++++++++++------ 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/src/Admin/src/Service/AdminLoginService.php b/src/Admin/src/Service/AdminLoginService.php index 0da33ec..7577df2 100644 --- a/src/Admin/src/Service/AdminLoginService.php +++ b/src/Admin/src/Service/AdminLoginService.php @@ -111,24 +111,50 @@ private function logAdminVisit(array $serverParams, string $name, SuccessFailure $continent = $this->locationService->getContinent($ipAddress)->getName(); $organization = $this->locationService->getOrganization($ipAddress)->getName(); - $adminLogin = (new AdminLogin()) - ->setAdminIp($this->locationService->obfuscateIpAddress($ipAddress)) - ->setContinent($continent) - ->setCountry($country) - ->setOrganization($organization) - ->setDeviceType(null) - ->setDeviceBrand(null) - ->setDeviceModel(null) - ->setIsMobile(YesNoEnum::No) - ->setOsName(null) - ->setOsVersion(null) - ->setOsPlatform(null) - ->setClientType(null) - ->setClientName(null) - ->setClientEngine(null) - ->setClientVersion(null) - ->setLoginStatus($status) - ->setIdentity($name); + //check browscap availability + if (ini_get('browscap')) { + //call browscap + $browser = get_browser($_SERVER['HTTP_USER_AGENT'], true); + + //map browscap to AdminLogin + $adminLogin = (new AdminLogin()) + ->setAdminIp($this->locationService->obfuscateIpAddress($ipAddress)) + ->setContinent($continent) + ->setCountry($country) + ->setOrganization($organization) + ->setDeviceType($browser['device_type']) + ->setDeviceBrand($browser['device_name']) + ->setDeviceModel(null) + ->setIsMobile($browser['ismobiledevice'] ? YesNoEnum::Yes : YesNoEnum::No) + ->setOsName($browser['platform_description']) + ->setOsVersion($browser['platform_version']) + ->setOsPlatform($browser['platform']) + ->setClientType($browser['browser_type']) + ->setClientName($browser['browser']) + ->setClientEngine($browser['renderingengine_name']) + ->setClientVersion(null) + ->setLoginStatus($status) + ->setIdentity($name); + } else { + $adminLogin = (new AdminLogin()) + ->setAdminIp($this->locationService->obfuscateIpAddress($ipAddress)) + ->setContinent($continent) + ->setCountry($country) + ->setOrganization($organization) + ->setDeviceType(null) + ->setDeviceBrand(null) + ->setDeviceModel(null) + ->setIsMobile(YesNoEnum::No) + ->setOsName(null) + ->setOsVersion(null) + ->setOsPlatform(null) + ->setClientType(null) + ->setClientName(null) + ->setClientEngine(null) + ->setClientVersion(null) + ->setLoginStatus($status) + ->setIdentity($name); + } $this->adminLoginRepository->saveResource($adminLogin); From db94c94a62535731f2d4cff1fadf13e2ba989fb1 Mon Sep 17 00:00:00 2001 From: bidi Date: Fri, 17 Apr 2026 13:26:52 +0300 Subject: [PATCH 2/6] updated browscap mapping Signed-off-by: bidi --- src/Admin/src/Service/AdminLoginService.php | 24 ++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/Admin/src/Service/AdminLoginService.php b/src/Admin/src/Service/AdminLoginService.php index 7577df2..9044ddc 100644 --- a/src/Admin/src/Service/AdminLoginService.php +++ b/src/Admin/src/Service/AdminLoginService.php @@ -15,7 +15,9 @@ use Dot\GeoIP\Service\LocationService; use Exception; +use function get_browser; use function in_array; +use function ini_get; class AdminLoginService implements AdminLoginServiceInterface { @@ -114,7 +116,7 @@ private function logAdminVisit(array $serverParams, string $name, SuccessFailure //check browscap availability if (ini_get('browscap')) { //call browscap - $browser = get_browser($_SERVER['HTTP_USER_AGENT'], true); + $browser = get_browser($_SERVER['HTTP_USER_AGENT']); //map browscap to AdminLogin $adminLogin = (new AdminLogin()) @@ -122,16 +124,18 @@ private function logAdminVisit(array $serverParams, string $name, SuccessFailure ->setContinent($continent) ->setCountry($country) ->setOrganization($organization) - ->setDeviceType($browser['device_type']) - ->setDeviceBrand($browser['device_name']) + ->setDeviceType($browser->device_type ?? null) + ->setDeviceBrand($browser->device_name ?? null) ->setDeviceModel(null) - ->setIsMobile($browser['ismobiledevice'] ? YesNoEnum::Yes : YesNoEnum::No) - ->setOsName($browser['platform_description']) - ->setOsVersion($browser['platform_version']) - ->setOsPlatform($browser['platform']) - ->setClientType($browser['browser_type']) - ->setClientName($browser['browser']) - ->setClientEngine($browser['renderingengine_name']) + ->setIsMobile( + isset($browser->ismobiledevice) && $browser->ismobiledevice ? YesNoEnum::Yes : YesNoEnum::No + ) + ->setOsName($browser->platform_description ?? null) + ->setOsVersion($browser->platform_version ?? null) + ->setOsPlatform($browser->platform ?? null) + ->setClientType($browser->browser_type ?? null) + ->setClientName($browser->browser ?? null) + ->setClientEngine($browser->renderingengine_name ?? null) ->setClientVersion(null) ->setLoginStatus($status) ->setIdentity($name); From dd6e90871b7df6eefd7469bc11da19c3b2399d93 Mon Sep 17 00:00:00 2001 From: bidi Date: Fri, 17 Apr 2026 15:21:49 +0300 Subject: [PATCH 3/6] updated browscap Signed-off-by: bidi --- src/Admin/src/Service/AdminLoginService.php | 63 +++++++-------------- 1 file changed, 22 insertions(+), 41 deletions(-) diff --git a/src/Admin/src/Service/AdminLoginService.php b/src/Admin/src/Service/AdminLoginService.php index 9044ddc..b0209f3 100644 --- a/src/Admin/src/Service/AdminLoginService.php +++ b/src/Admin/src/Service/AdminLoginService.php @@ -117,49 +117,30 @@ private function logAdminVisit(array $serverParams, string $name, SuccessFailure if (ini_get('browscap')) { //call browscap $browser = get_browser($_SERVER['HTTP_USER_AGENT']); - - //map browscap to AdminLogin - $adminLogin = (new AdminLogin()) - ->setAdminIp($this->locationService->obfuscateIpAddress($ipAddress)) - ->setContinent($continent) - ->setCountry($country) - ->setOrganization($organization) - ->setDeviceType($browser->device_type ?? null) - ->setDeviceBrand($browser->device_name ?? null) - ->setDeviceModel(null) - ->setIsMobile( - isset($browser->ismobiledevice) && $browser->ismobiledevice ? YesNoEnum::Yes : YesNoEnum::No - ) - ->setOsName($browser->platform_description ?? null) - ->setOsVersion($browser->platform_version ?? null) - ->setOsPlatform($browser->platform ?? null) - ->setClientType($browser->browser_type ?? null) - ->setClientName($browser->browser ?? null) - ->setClientEngine($browser->renderingengine_name ?? null) - ->setClientVersion(null) - ->setLoginStatus($status) - ->setIdentity($name); - } else { - $adminLogin = (new AdminLogin()) - ->setAdminIp($this->locationService->obfuscateIpAddress($ipAddress)) - ->setContinent($continent) - ->setCountry($country) - ->setOrganization($organization) - ->setDeviceType(null) - ->setDeviceBrand(null) - ->setDeviceModel(null) - ->setIsMobile(YesNoEnum::No) - ->setOsName(null) - ->setOsVersion(null) - ->setOsPlatform(null) - ->setClientType(null) - ->setClientName(null) - ->setClientEngine(null) - ->setClientVersion(null) - ->setLoginStatus($status) - ->setIdentity($name); } + //map browscap to AdminLogin + $adminLogin = (new AdminLogin()) + ->setAdminIp($this->locationService->obfuscateIpAddress($ipAddress)) + ->setContinent($continent) + ->setCountry($country) + ->setOrganization($organization) + ->setDeviceType($browser->device_type ?? null) + ->setDeviceBrand($browser->device_name ?? null) + ->setDeviceModel(null) + ->setIsMobile( + isset($browser->ismobiledevice) && $browser->ismobiledevice ? YesNoEnum::Yes : YesNoEnum::No + ) + ->setOsName($browser->platform_description ?? null) + ->setOsVersion($browser->platform_version ?? null) + ->setOsPlatform($browser->platform ?? null) + ->setClientType($browser->browser_type ?? null) + ->setClientName($browser->browser ?? null) + ->setClientEngine($browser->renderingengine_name ?? null) + ->setClientVersion(null) + ->setLoginStatus($status) + ->setIdentity($name); + $this->adminLoginRepository->saveResource($adminLogin); return $adminLogin; From 3ec10f4746d3f7d1f494a214e6d11f58e65157d1 Mon Sep 17 00:00:00 2001 From: bidi Date: Fri, 17 Apr 2026 15:40:17 +0300 Subject: [PATCH 4/6] added browscap comment Signed-off-by: bidi --- src/Admin/src/Service/AdminLoginService.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Admin/src/Service/AdminLoginService.php b/src/Admin/src/Service/AdminLoginService.php index b0209f3..168f310 100644 --- a/src/Admin/src/Service/AdminLoginService.php +++ b/src/Admin/src/Service/AdminLoginService.php @@ -113,13 +113,16 @@ private function logAdminVisit(array $serverParams, string $name, SuccessFailure $continent = $this->locationService->getContinent($ipAddress)->getName(); $organization = $this->locationService->getOrganization($ipAddress)->getName(); - //check browscap availability + /** + * For browscap information + * + * @see https://www.php.net/manual/en/function.get-browser.php + */ + if (ini_get('browscap')) { - //call browscap $browser = get_browser($_SERVER['HTTP_USER_AGENT']); } - //map browscap to AdminLogin $adminLogin = (new AdminLogin()) ->setAdminIp($this->locationService->obfuscateIpAddress($ipAddress)) ->setContinent($continent) From e7bbdcfdebc387276cd88be15f601ce9424ab305 Mon Sep 17 00:00:00 2001 From: bidi Date: Fri, 17 Apr 2026 15:48:32 +0300 Subject: [PATCH 5/6] phpcs fixes Signed-off-by: bidi --- src/Admin/src/Service/AdminLoginService.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Admin/src/Service/AdminLoginService.php b/src/Admin/src/Service/AdminLoginService.php index 168f310..7e3dc4e 100644 --- a/src/Admin/src/Service/AdminLoginService.php +++ b/src/Admin/src/Service/AdminLoginService.php @@ -118,7 +118,6 @@ private function logAdminVisit(array $serverParams, string $name, SuccessFailure * * @see https://www.php.net/manual/en/function.get-browser.php */ - if (ini_get('browscap')) { $browser = get_browser($_SERVER['HTTP_USER_AGENT']); } From 47d123ac570a23d0dd9ccba848e88af1849b0494 Mon Sep 17 00:00:00 2001 From: bidi Date: Mon, 20 Apr 2026 18:34:23 +0300 Subject: [PATCH 6/6] updated admin login columns Signed-off-by: bidi --- src/Admin/src/Service/AdminLoginService.php | 32 ++--- .../admin/list-admin-login.html.twig | 28 ++--- src/Core/src/Admin/src/Entity/AdminLogin.php | 116 ++++-------------- test/Unit/Admin/Entity/AdminLoginTest.php | 27 +--- 4 files changed, 47 insertions(+), 156 deletions(-) diff --git a/src/Admin/src/Service/AdminLoginService.php b/src/Admin/src/Service/AdminLoginService.php index 7e3dc4e..ffd0c6e 100644 --- a/src/Admin/src/Service/AdminLoginService.php +++ b/src/Admin/src/Service/AdminLoginService.php @@ -14,6 +14,7 @@ use Dot\DependencyInjection\Attribute\Inject; use Dot\GeoIP\Service\LocationService; use Exception; +use stdClass; use function get_browser; use function in_array; @@ -51,16 +52,12 @@ public function getAdminLogins(array $params): array 'login.continent', 'login.organization', 'login.deviceType', - 'login.deviceBrand', - 'login.deviceModel', 'login.isMobile', 'login.osName', 'login.osVersion', - 'login.osPlatform', 'login.clientType', 'login.clientName', - 'login.clientEngine', - 'login.clientVersion', + 'login.isCrawler', 'login.loginStatus', 'login.identity', 'login.created', @@ -101,12 +98,6 @@ public function logSuccessfulLogin(array $serverParams, string $name): AdminLogi */ private function logAdminVisit(array $serverParams, string $name, SuccessFailureEnum $status): AdminLogin { - /** - * For device information - * - * @see https://github.com/dotkernel/dot-user-agent-sniffer - */ - $ipAddress = IpService::getUserIp($serverParams); $country = $this->locationService->getCountry($ipAddress)->getName(); @@ -118,6 +109,7 @@ private function logAdminVisit(array $serverParams, string $name, SuccessFailure * * @see https://www.php.net/manual/en/function.get-browser.php */ + $browser = new stdClass(); if (ini_get('browscap')) { $browser = get_browser($_SERVER['HTTP_USER_AGENT']); } @@ -127,20 +119,16 @@ private function logAdminVisit(array $serverParams, string $name, SuccessFailure ->setContinent($continent) ->setCountry($country) ->setOrganization($organization) - ->setDeviceType($browser->device_type ?? null) - ->setDeviceBrand($browser->device_name ?? null) - ->setDeviceModel(null) + ->setDeviceType(! empty($browser->device_type) ? $browser->device_type : null) ->setIsMobile( - isset($browser->ismobiledevice) && $browser->ismobiledevice ? YesNoEnum::Yes : YesNoEnum::No + ! empty($browser->ismobiledevice) ? YesNoEnum::Yes : YesNoEnum::No ) - ->setOsName($browser->platform_description ?? null) - ->setOsVersion($browser->platform_version ?? null) - ->setOsPlatform($browser->platform ?? null) - ->setClientType($browser->browser_type ?? null) - ->setClientName($browser->browser ?? null) - ->setClientEngine($browser->renderingengine_name ?? null) - ->setClientVersion(null) + ->setOsName(! empty($browser->platform) ? $browser->platform : null) + ->setOsVersion(! empty($browser->platform_version) ? $browser->platform_version : null) + ->setClientType(! empty($browser->browser_type) ? $browser->browser_type : null) + ->setClientName(! empty($browser->browser) ? $browser->browser : null) ->setLoginStatus($status) + ->setIsCrawler(! empty($browser->crawler) ? YesNoEnum::Yes : YesNoEnum::No) ->setIdentity($name); $this->adminLoginRepository->saveResource($adminLogin); diff --git a/src/Admin/templates/admin/list-admin-login.html.twig b/src/Admin/templates/admin/list-admin-login.html.twig index 6e66a7e..cab7aa7 100644 --- a/src/Admin/templates/admin/list-admin-login.html.twig +++ b/src/Admin/templates/admin/list-admin-login.html.twig @@ -76,12 +76,6 @@ {{ sortableColumn('admin::list-admin-login', {}, pagination.queryParams, 'login.deviceType', 'Device Type') }} - - {{ sortableColumn('admin::list-admin-login', {}, pagination.queryParams, 'login.deviceBrand', 'Device Brand') }} - - - {{ sortableColumn('admin::list-admin-login', {}, pagination.queryParams, 'login.deviceModel', 'Device Model') }} - {{ sortableColumn('admin::list-admin-login', {}, pagination.queryParams, 'login.isMobile', 'Is Mobile') }} @@ -91,20 +85,14 @@ {{ sortableColumn('admin::list-admin-login', {}, pagination.queryParams, 'login.osVersion', 'Os Version') }} - - {{ sortableColumn('admin::list-admin-login', {}, pagination.queryParams, 'login.osPlatform', 'Os Platform') }} - {{ sortableColumn('admin::list-admin-login', {}, pagination.queryParams, 'login.clientType', 'Client Type') }} {{ sortableColumn('admin::list-admin-login', {}, pagination.queryParams, 'login.clientName', 'Client Name') }} - - {{ sortableColumn('admin::list-admin-login', {}, pagination.queryParams, 'login.clientEngine', 'Client Engine') }} - - - {{ sortableColumn('admin::list-admin-login', {}, pagination.queryParams, 'login.clientVersion', 'Client Version') }} + + {{ sortableColumn('admin::list-admin-login', {}, pagination.queryParams, 'login.isCrawler', 'Is Crawler') }} {{ sortableColumn('admin::list-admin-login', {}, pagination.queryParams, 'login.created', 'Created') }} @@ -127,8 +115,6 @@ {{ login.continent }} {{ login.organization }} {{ login.deviceType }} - {{ login.deviceBrand }} - {{ login.deviceModel }} {% if login.isMobile.value == 'yes' %} Yes @@ -138,11 +124,15 @@ {{ login.osName }} {{ login.osVersion }} - {{ login.osPlatform }} {{ login.clientType }} {{ login.clientName }} - {{ login.clientEngine }} - {{ login.clientVersion }} + + {% if login.isCrawler.value == 'yes' %} + Yes + {% else %} + No + {% endif %} + {{ login.getCreated()|date('Y-m-d H:i:s') }} {% endfor %} diff --git a/src/Core/src/Admin/src/Entity/AdminLogin.php b/src/Core/src/Admin/src/Entity/AdminLogin.php index 1ced9af..d530479 100644 --- a/src/Core/src/Admin/src/Entity/AdminLogin.php +++ b/src/Core/src/Admin/src/Entity/AdminLogin.php @@ -39,12 +39,6 @@ class AdminLogin extends AbstractEntity #[ORM\Column(name: 'deviceType', type: 'string', length: 191, nullable: true)] protected ?string $deviceType = null; - #[ORM\Column(name: 'deviceBrand', type: 'string', length: 191, nullable: true)] - protected ?string $deviceBrand = null; - - #[ORM\Column(name: 'deviceModel', type: 'string', length: 40, nullable: true)] - protected ?string $deviceModel = null; - #[ORM\Column(type: 'yes_no_enum', nullable: true, enumType: YesNoEnum::class)] protected YesNoEnum $isMobile = YesNoEnum::No; @@ -54,20 +48,14 @@ class AdminLogin extends AbstractEntity #[ORM\Column(name: 'osVersion', type: 'string', length: 191, nullable: true)] protected ?string $osVersion = null; - #[ORM\Column(name: 'osPlatform', type: 'string', length: 191, nullable: true)] - protected ?string $osPlatform = null; - #[ORM\Column(name: 'clientType', type: 'string', length: 191, nullable: true)] protected ?string $clientType = null; #[ORM\Column(name: 'clientName', type: 'string', length: 191, nullable: true)] protected ?string $clientName = null; - #[ORM\Column(name: 'clientEngine', type: 'string', length: 191, nullable: true)] - protected ?string $clientEngine = null; - - #[ORM\Column(name: 'clientVersion', type: 'string', length: 191, nullable: true)] - protected ?string $clientVersion = null; + #[ORM\Column(type: 'yes_no_enum', nullable: true, enumType: YesNoEnum::class)] + protected YesNoEnum $isCrawler = YesNoEnum::No; #[ORM\Column(type: 'success_failure_enum', nullable: true, enumType: SuccessFailureEnum::class)] protected SuccessFailureEnum $loginStatus = SuccessFailureEnum::Fail; @@ -144,30 +132,6 @@ public function setDeviceType(?string $deviceType): self return $this; } - public function getDeviceBrand(): ?string - { - return $this->deviceBrand; - } - - public function setDeviceBrand(?string $deviceBrand): self - { - $this->deviceBrand = $deviceBrand; - - return $this; - } - - public function getDeviceModel(): ?string - { - return $this->deviceModel; - } - - public function setDeviceModel(?string $deviceModel): self - { - $this->deviceModel = $deviceModel; - - return $this; - } - public function getIsMobile(): ?YesNoEnum { return $this->isMobile; @@ -204,18 +168,6 @@ public function setOsVersion(?string $osVersion): self return $this; } - public function getOsPlatform(): ?string - { - return $this->osPlatform; - } - - public function setOsPlatform(?string $osPlatform): self - { - $this->osPlatform = $osPlatform; - - return $this; - } - public function getClientType(): ?string { return $this->clientType; @@ -240,26 +192,14 @@ public function setClientName(?string $clientName): self return $this; } - public function getClientEngine(): ?string - { - return $this->clientEngine; - } - - public function setClientEngine(?string $clientEngine): self - { - $this->clientEngine = $clientEngine; - - return $this; - } - - public function getClientVersion(): ?string + public function getIsCrawler(): ?YesNoEnum { - return $this->clientVersion; + return $this->isCrawler; } - public function setClientVersion(?string $clientVersion): self + public function setIsCrawler(YesNoEnum $isCrawler): self { - $this->clientVersion = $clientVersion; + $this->isCrawler = $isCrawler; return $this; } @@ -285,16 +225,12 @@ public function setLoginStatus(SuccessFailureEnum $loginStatus): self * continent: string|null, * organization: string|null, * deviceType: string|null, - * deviceBrand: string|null, - * deviceModel: string|null, - * isMobile: string, + * isMobile: 'no'|'yes', * osName: string|null, * osVersion: string|null, - * osPlatform: string|null, * clientType: string|null, * clientName: string|null, - * clientEngine: string|null, - * clientVersion: string|null, + * isCrawler: 'no'|'yes', * loginStatus: string, * created: DateTimeImmutable|null, * updated: DateTimeImmutable|null, @@ -303,26 +239,22 @@ public function setLoginStatus(SuccessFailureEnum $loginStatus): self public function getArrayCopy(): array { return [ - 'id' => $this->id->toString(), - 'identity' => $this->identity, - 'adminIp' => $this->adminIp, - 'country' => $this->country, - 'continent' => $this->continent, - 'organization' => $this->organization, - 'deviceType' => $this->deviceType, - 'deviceBrand' => $this->deviceBrand, - 'deviceModel' => $this->deviceModel, - 'isMobile' => $this->isMobile->value, - 'osName' => $this->osName, - 'osVersion' => $this->osVersion, - 'osPlatform' => $this->osPlatform, - 'clientType' => $this->clientType, - 'clientName' => $this->clientName, - 'clientEngine' => $this->clientEngine, - 'clientVersion' => $this->clientVersion, - 'loginStatus' => $this->loginStatus->value, - 'created' => $this->created, - 'updated' => $this->updated, + 'id' => $this->id->toString(), + 'identity' => $this->identity, + 'adminIp' => $this->adminIp, + 'country' => $this->country, + 'continent' => $this->continent, + 'organization' => $this->organization, + 'deviceType' => $this->deviceType, + 'isMobile' => $this->isMobile->value, + 'osName' => $this->osName, + 'osVersion' => $this->osVersion, + 'clientType' => $this->clientType, + 'clientName' => $this->clientName, + 'isCrawler' => $this->isCrawler->value, + 'loginStatus' => $this->loginStatus->value, + 'created' => $this->created, + 'updated' => $this->updated, ]; } } diff --git a/test/Unit/Admin/Entity/AdminLoginTest.php b/test/Unit/Admin/Entity/AdminLoginTest.php index a43831d..3dfce8b 100644 --- a/test/Unit/Admin/Entity/AdminLoginTest.php +++ b/test/Unit/Admin/Entity/AdminLoginTest.php @@ -67,16 +67,6 @@ public function testAccessors(): void $this->assertSame(AdminLogin::class, $adminLogin::class); $this->assertSame('test', $adminLogin->getDeviceType()); - $this->assertNull($adminLogin->getDeviceBrand()); - $adminLogin = $adminLogin->setDeviceBrand('test'); - $this->assertSame(AdminLogin::class, $adminLogin::class); - $this->assertSame('test', $adminLogin->getDeviceBrand()); - - $this->assertNull($adminLogin->getDeviceModel()); - $adminLogin = $adminLogin->setDeviceModel('test'); - $this->assertSame(AdminLogin::class, $adminLogin::class); - $this->assertSame('test', $adminLogin->getDeviceModel()); - $this->assertSame(YesNoEnum::No, $adminLogin->getIsMobile()); $adminLogin = $adminLogin->setIsMobile(YesNoEnum::Yes); $this->assertSame(AdminLogin::class, $adminLogin::class); @@ -93,11 +83,6 @@ public function testAccessors(): void $this->assertSame(AdminLogin::class, $adminLogin::class); $this->assertSame('test', $adminLogin->getOsVersion()); - $this->assertNull($adminLogin->getOsPlatform()); - $adminLogin = $adminLogin->setOsPlatform('test'); - $this->assertSame(AdminLogin::class, $adminLogin::class); - $this->assertSame('test', $adminLogin->getOsPlatform()); - $this->assertNull($adminLogin->getClientType()); $adminLogin = $adminLogin->setClientType('test'); $this->assertSame(AdminLogin::class, $adminLogin::class); @@ -108,15 +93,11 @@ public function testAccessors(): void $this->assertSame(AdminLogin::class, $adminLogin::class); $this->assertSame('test', $adminLogin->getClientName()); - $this->assertNull($adminLogin->getClientEngine()); - $adminLogin = $adminLogin->setClientEngine('test'); - $this->assertSame(AdminLogin::class, $adminLogin::class); - $this->assertSame('test', $adminLogin->getClientEngine()); - - $this->assertNull($adminLogin->getClientVersion()); - $adminLogin = $adminLogin->setClientVersion('test'); + $this->assertSame(YesNoEnum::No, $adminLogin->getIsCrawler()); + $adminLogin = $adminLogin->setIsCrawler(YesNoEnum::Yes); $this->assertSame(AdminLogin::class, $adminLogin::class); - $this->assertSame('test', $adminLogin->getClientVersion()); + $this->assertNotNull($adminLogin->getIsCrawler()); + $this->assertSame('yes', $adminLogin->getIsCrawler()->value); $this->assertSame(SuccessFailureEnum::Fail, $adminLogin->getLoginStatus()); $adminLogin = $adminLogin->setLoginStatus(SuccessFailureEnum::Success);