Skip to content

Commit

Permalink
Update deprecated domain
Browse files Browse the repository at this point in the history
  • Loading branch information
cbaconnier committed May 21, 2024
1 parent 47c9cc7 commit 8baf602
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
10 changes: 5 additions & 5 deletions src/Clients/ZohoUrlFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ protected function baseApiUrl(ZohoModules $module): string
'CN' => 'https://www.zohoapis.com.cn/books/v3',
],
ZohoModules::CRM->value => [
'EU' => 'https://www.zohoapis.eu/crm/v3',
'US' => 'https://www.zohoapis.com/crm/v3',
'IN' => 'https://www.zohoapis.in/crm/v3',
'AU' => 'https://www.zohoapis.com.au/crm/v3',
'CN' => 'https://www.zohoapis.com.cn/crm/v3',
'EU' => 'https://www.zohoapis.eu/crm/v6',
'US' => 'https://www.zohoapis.com/crm/v6',
'IN' => 'https://www.zohoapis.in/crm/v6',
'AU' => 'https://www.zohoapis.com.au/crm/v6',
'CN' => 'https://www.zohoapis.com.cn/crm/v6',
],
ZohoModules::RECRUIT->value => [
'EU' => 'https://recruit.zoho.eu/recruit/v2',
Expand Down
11 changes: 5 additions & 6 deletions tests/Clients/ZohoUrlFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function it_build_url_for_a_module(): void
$urlFactory = app(ZohoUrlFactory::class);

$this->assertEquals(
'https://www.zohoapis.eu/crm/v3/users/4',
'https://www.zohoapis.eu/crm/v6/users/4',
$urlFactory->api(ZohoModules::CRM, '/users/4')
);

Expand All @@ -47,7 +47,7 @@ public function it_returns_the_base_urls_for_the_api(): void
$urlFactory = app(ZohoUrlFactory::class);

$this->assertEquals(
'https://www.zohoapis.eu/crm/v3',
'https://www.zohoapis.eu/crm/v6',
invade($urlFactory)->baseApiUrl(ZohoModules::CRM)
);

Expand Down Expand Up @@ -126,7 +126,7 @@ public function it_build_using_api_method(): void
$urlFactory = app(ZohoUrlFactory::class);

$this->assertEquals(
'https://www.zohoapis.eu/crm/v3/users/4',
'https://www.zohoapis.eu/crm/v6/users/4',
$urlFactory->api(ZohoModules::CRM, '/users/4')
);

Expand All @@ -141,7 +141,6 @@ public function it_build_using_api_method(): void
);
}


/** @test */
public function it_build_using_web_method(): void
{
Expand Down Expand Up @@ -169,7 +168,7 @@ public function it_adds_parameter_to_api_url()
$urlFactory = app(ZohoUrlFactory::class);

$this->assertEquals(
'https://www.zohoapis.eu/crm/v3/users/4?foo=1&bar=2&baz=3',
'https://www.zohoapis.eu/crm/v6/users/4?foo=1&bar=2&baz=3',
$urlFactory->api(ZohoModules::CRM, '/users/4', [
'foo' => 1,
'bar' => 2,
Expand All @@ -178,7 +177,7 @@ public function it_adds_parameter_to_api_url()
);

$this->assertEquals(
'https://www.zohoapis.eu/crm/v3/users/4?foo=1&bar=2&baz=3',
'https://www.zohoapis.eu/crm/v6/users/4?foo=1&bar=2&baz=3',
$urlFactory->api(ZohoModules::CRM, '/users/4?foo=1', [
'bar' => 2,
'baz' => 3,
Expand Down
26 changes: 12 additions & 14 deletions tests/Zoho/ZohoHttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ protected function tearDown(): void
}

protected array $fakeResponse = [
"users" => [
'users' => [
[
"country" => "US",
"street" => null,
"id" => "4150868000000225013",
"first_name" => "Patricia",
"last_name" => "Boyle",
'country' => 'US',
'street' => null,
'id' => '4150868000000225013',
'first_name' => 'Patricia',
'last_name' => 'Boyle',
],
],
"info" => [
"per_page" => 200,
"count" => 3,
"page" => 1,
"more_records" => false,
'info' => [
'per_page' => 200,
'count' => 3,
'page' => 1,
'more_records' => false,
],
];

Expand All @@ -68,7 +68,7 @@ public function it_can_make_a_request_using_header(): void
public function it_can_make_a_request_zoho_url_facade(): void
{
Http::fake([
'https://www.zohoapis.com/crm/v3/users' => Http::response($this->fakeResponse),
'https://www.zohoapis.com/crm/v6/users' => Http::response($this->fakeResponse),
]);

$this->assertEquals(
Expand All @@ -78,6 +78,4 @@ public function it_can_make_a_request_zoho_url_facade(): void
->json()
);
}


}

0 comments on commit 8baf602

Please sign in to comment.