diff --git a/src/Clients/ZohoUrlFactory.php b/src/Clients/ZohoUrlFactory.php index 8d18dcf..4007570 100644 --- a/src/Clients/ZohoUrlFactory.php +++ b/src/Clients/ZohoUrlFactory.php @@ -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', diff --git a/tests/Clients/ZohoUrlFactoryTest.php b/tests/Clients/ZohoUrlFactoryTest.php index 2e40c50..d7548b8 100644 --- a/tests/Clients/ZohoUrlFactoryTest.php +++ b/tests/Clients/ZohoUrlFactoryTest.php @@ -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') ); @@ -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) ); @@ -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') ); @@ -141,7 +141,6 @@ public function it_build_using_api_method(): void ); } - /** @test */ public function it_build_using_web_method(): void { @@ -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, @@ -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, diff --git a/tests/Zoho/ZohoHttpTest.php b/tests/Zoho/ZohoHttpTest.php index 40c594a..6fb587c 100644 --- a/tests/Zoho/ZohoHttpTest.php +++ b/tests/Zoho/ZohoHttpTest.php @@ -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, ], ]; @@ -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( @@ -78,6 +78,4 @@ public function it_can_make_a_request_zoho_url_facade(): void ->json() ); } - - }