Skip to content

Commit

Permalink
Fix deprecated domain
Browse files Browse the repository at this point in the history
  • Loading branch information
cbaconnier committed May 21, 2024
1 parent acac7ee commit 3e145ad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/Clients/ZohoUrlFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
14 changes: 7 additions & 7 deletions tests/Clients/ZohoUrlFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
);

Expand All @@ -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)
);

Expand Down Expand Up @@ -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')
);

Expand All @@ -107,15 +107,15 @@ 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)
);

$this->mock(StorageConfigRepository::class, static function (MockInterface $repository) {
$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)
);
}
Expand All @@ -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')
);

Expand Down

0 comments on commit 3e145ad

Please sign in to comment.