From 3e145ad96a68ae1daccceff8e5aa1e6306a4f2b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Baconnier?= Date: Tue, 21 May 2024 09:30:38 +0200 Subject: [PATCH] Fix deprecated domain --- src/Clients/ZohoUrlFactory.php | 10 +++++----- tests/Clients/ZohoUrlFactoryTest.php | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Clients/ZohoUrlFactory.php b/src/Clients/ZohoUrlFactory.php index 0667d3c..e4e36a8 100644 --- a/src/Clients/ZohoUrlFactory.php +++ b/src/Clients/ZohoUrlFactory.php @@ -118,11 +118,11 @@ protected function baseApiUrl(ZohoModules $module): string return [ ZohoModules::BOOKS->value => [ - 'EU' => 'https://books.zoho.eu/api/v3', - 'US' => 'https://books.zoho.com/api/v3', - 'IN' => 'https://books.zoho.in/api/v3', - 'AU' => 'https://books.zoho.com.au/api/v3', - 'CN' => 'https://books.zoho.com.cn/api/v3', + 'EU' => 'https://zohoapis.eu/books/v3', + 'US' => 'https://zohoapis.com/books/v3', + 'IN' => 'https://zohoapis.in/books/v3', + 'AU' => 'https://zohoapis.com.au/books/v3', + 'CN' => 'https://zohoapis.com.cn/books/v3', ], ZohoModules::CRM->value => [ 'EU' => 'https://www.zohoapis.eu/crm/v3', diff --git a/tests/Clients/ZohoUrlFactoryTest.php b/tests/Clients/ZohoUrlFactoryTest.php index 73dae9c..98827d3 100644 --- a/tests/Clients/ZohoUrlFactoryTest.php +++ b/tests/Clients/ZohoUrlFactoryTest.php @@ -31,7 +31,7 @@ public function it_build_url_for_a_module(): void ); $this->assertEquals( - 'https://books.zoho.eu/api/v3/invoices?organization_id=1234', + 'https://zohoapis.eu/books/v3/invoices?organization_id=1234', $urlFactory->api(ZohoModules::BOOKS, '/invoices') ); @@ -52,7 +52,7 @@ public function it_returns_the_base_urls_for_the_api(): void ); $this->assertEquals( - 'https://books.zoho.eu/api/v3', + 'https://zohoapis.eu/books/v3', invade($urlFactory)->baseApiUrl(ZohoModules::BOOKS) ); @@ -89,12 +89,12 @@ public function it_add_the_current_organization_id_to_url_when_using_books(): vo $urlFactory = app(ZohoUrlFactory::class); $this->assertEquals( - 'https://books.zoho.eu/api/v3/invoices?organization_id=1234', + 'https://zohoapis.eu/books/v3/invoices?organization_id=1234', $urlFactory->api(ZohoModules::BOOKS, '/invoices') ); $this->assertEquals( - 'https://books.zoho.eu/api/v3/invoices?param_1=param&organization_id=1234', + 'https://zohoapis.eu/books/v3/invoices?param_1=param&organization_id=1234', $urlFactory->api(ZohoModules::BOOKS, '/invoices?param_1=param') ); @@ -107,7 +107,7 @@ public function it_uses_the_region(): void $repository->shouldReceive('region')->andReturn('EU'); }); $this->assertEquals( - 'https://books.zoho.eu/api/v3', + 'https://zohoapis.eu/books/v3', invade(app(ZohoUrlFactory::class))->baseApiUrl(ZohoModules::BOOKS) ); @@ -115,7 +115,7 @@ public function it_uses_the_region(): void $repository->shouldReceive('region')->andReturn('US'); }); $this->assertEquals( - 'https://books.zoho.com/api/v3', + 'https://zohoapis.com/books/v3', invade(app(ZohoUrlFactory::class))->baseApiUrl(ZohoModules::BOOKS) ); } @@ -131,7 +131,7 @@ public function it_build_using_api_method(): void ); $this->assertEquals( - 'https://books.zoho.eu/api/v3/invoices?organization_id=1234', + 'https://zohoapis.eu/books/v3/invoices?organization_id=1234', $urlFactory->api(ZohoModules::BOOKS, '/invoices') );